黑龙江快乐十分

如何使Linux服务器变得更安全

10/21/2015来源:网络管理人气:18092

黑龙江快乐十分  laojiyixiazheiqidianhuirangnidefuwuqibiandegenganquan

928.jpg

  tu1:yunxingzhongdefuwu。

  anzhuangsuoxudefuwu

黑龙江快乐十分  ruguonidasuanyunxingyitaifuwuqi,kenenghuixiang“woyoulaizilinodede40gbgutaiyingpan(ssd)cunchuxitong,yushiwokeyianzhuangxiangyaoanzhuangderenhefuwu。”meicuo,nidedipannizuozhu:keyizaifuwuqishanganzhuangrenyiruanjian。buguo,biefanxiangdangrandemaobing。lianzuiguruojintangdefuwuqiyehuiyinyourenzuanlezaigaifuwuqishangyunxingderenheweidabudinghuoyishougongjideruanjiandekongzierbeijiechi。

  suoyi,touyitiaoguizejiushirangnidefuwuqijinliangjingjian。zhianzhuangniqueshixuyaodeneixiechengxubao。yaoshiyoubuxuyaodechengxubao,neijiuqingchu。chengxubaoshuliangyueshao,daimameidashangbudingdekenengxingjiuyuexiao。zaianzhuangrenheruanjianheyilaichengxubao(biruowncloud)zhiqian,niyinggaiduyixiaownclouddeshuomingwendang,zhianzhuangtaxuyaodeneixiechengxubao。

  yunxingsuoxudefuwu

黑龙江快乐十分  diertiaoguizejiushizhiyunxingxuyaodeneixiefuwu。xuduofaxingbanhuochengxubaokenenghuikaiqimouxiefuwu,zaibutongdeduankoushangyunxing。zheikenenghuidailaianquanfengxian。yushi,dakaizhongduan,yunxingxialiemingling:netstat -npl

  shuchujieguohuixianshinaxiefuwuzainaxieduankoushangyunxing。ruguonifaxianrenhebuyinggaiyunxingdefuwu,tingzhita。nihaiyinggaimiqieguanzhuyibeiqiyong、xitongqidongshiyunxingdefuwu。zhiyaozaiyunxingsystemddexitongshangyunxingxialiemingling,jiukeyilaijianchazheifangmian:systemctl list-unit-files --type=service | grep enabled

  shixitongerding,nihuihuoderushangtu1zhongsuoshideshuchujieguo。yaoshinifaxianrenhebuxuyaodefuwu,keyishiyongqiangdadesystemct1minglinglaijinyongta:systemctl disable service_name

  xianzhiduifuwuqidefangwen

  jiuhaobinibuhuibazijiayaochisuisuibianbianjiaojirenshideren,yebuhuijiangfangwenfuwuqidequanxianjiaosuisuibianbianshouyurenshideren。yidanmingquelezheigeguize,jiukeyixianzhiduifuwuqidefangwen。yaolaojizheidian:zheiyiqiedaxiaobulejueyiyaopohuainifuwuqidehuairendeniantou。buguo,qizuoyongzaiyuweinidefuwuqizengtianleduoyicengdeanquan,fangfanzhishijianloudebufafenzi。

黑龙江快乐十分  qianwanbuyaoyigenyonghudeshenfendenglu

  yichaojiyonghudeshenfentongguosshjinrudaofuwuqibushiyigehaozuofa。womenhoumianhuijinzhiyigenyonghushenfentongguosshjinrudaofuwuqi,buguozaizheimezuozhiqian,bufangchuangjianyigeyongyousudoquanxiandeyonghu,neiyangnijiunengtongguosshjinrudaofuwuqi,zhixingguanliyuanrenwule。yidannidenglujinrudaofuwuqi,zongshikeyijiangyonghuqiehuanchenggenyonghu,ruguoxuyaodehua。ruguoniyijingzaixitongshangyouleyonghu,jiutiaoguojibu;buran,genzhewozou。

  butongdefaxingbanshiyongbutongdefangfalaitianjiaxinyonghu;red hat/centosshiyonguseradd,/debianshiyonguser adduser。

黑龙江快乐十分  zaifedora/centosshangchuangjianxinyonghu:useradd swapnil

  ranhou,weigaiyonghuchuangjianmima:passwd swapnil

黑龙江快乐十分  tahuiyaoqiuniweitatigongyonghudexinmima。xianzai,nixuyaoweigaiyonghushouyusudoquanxian。yunxingxialiemingling:editor=nano visudo

黑龙江快乐十分  xunzhaoxiamianzheiyixing(jiantu2):# %wheel all=(all) all

929.jpg

黑龙江快乐十分  tu2:weiyonghushouyusudoquanxian。

黑龙江快乐十分  qudiaogaixingdezhushi(#fuhaoyiweizhegaixingbeizhushi;zhiyaoqudiaozheigefuhao,jikequdiaozhushi),neiyangtakanqilaijiuxiangzheiyang:%wheel all=(all) all

黑龙江快乐十分  xianzai,baocunbingguanbiwenjian。ruguoyonghubushuyuwheelzu,nizhiyaoyunxingxiamianzheigemingling,jiukeyijiangtaqingsongtianjiadaozu:# usermod -ag wheel swapnil

黑龙江快乐十分  zaiubuntuxitongshang,nikeyitianjiaxinyonghu,weiciyunxingxialiemingling:adduser swapnil

  huidaxitongtichudeyixiewenti,baokuoweigaiyonghuchuangjianmima。yidanchuangjianwanbi,weiyonghushouyusudoquanxian:gpasswd -a swapnil sudo

黑龙江快乐十分  dakailingyigezhongduanchuangkou,shizheyigangchuangjiandeyonghudeshenfendenglujinrudaofuwuqi,shizheyisudoquanxianzhixingyixieguanliyuanrenwu。yaoshiyiqiezhengchang,jinrudaoxiayibu。

  jinyonggenyonghudenglu

  womenxianzaiyaojinyonggenyonghudenglu,zheiyiweizhemeirennenggouyigenyonghudeshenfentongguosshhuodenglujinrudaofuwuqi。weici,dakaisshdpeizhiwenjian:nano /etc/ssh/sshd_conf

  xiayibu,xunzhaoxianshixialieneirongdezheiyizhushixing:#permitrootlogin no

  ranhoubaocunbingguanbigaiwenjian,zhongqifuwu:service ssh restarthuozhesystemctl restart sshd

  zhongyaotixing:zheishiqiemotuichufuwuqi。niyaoceshinengbunengshiyonggangchuangjiandeyonghuchenggongditongguosshjinrudaofuwuqi。dakaizhongduandelingyigeshili,yizhiqianchuangjiandeyonghutongguosshjinrudaofuwuqi。nibuxiwangwanquanbeisuozaifuwuqiwaimian。yaoshiyiqiedouzhengchang,nikeyiyigenyonghushenfenanquandizhuxiaotuichufuwuqi。

  biangengduankou

  womenduisshdpeizhiwenjianyaojinxingdediergebianhuajiushigenggaimorenduankou。zheizhuyaoshizengtianyicengyinnixing,rangnidefuwuqiquebaoanquan,erbushijifuwuqiguozhenzengtianrenheshijideanquanjizhi。zheijiuhaobibaoanfuwugongsipaiyiyangdechelianglaiyunsongzhongyaorenwu,neiyanggongjizhejiubuzhidaogaigongjinaxiechele。

黑龙江快乐十分  dakaisshd_configwenjian(zheihuiyisudoquanxiandakai,yinweinizaiyebunengyigenyonghushenfendenglujinrudaofuwuqile):sudo nano /etc/ssh/sshd_conf

黑龙江快乐十分  ranhou,zhaodaozheiyizhushixing:#port 22

黑龙江快乐十分  qudiaogaixingzhushi,xuanzeyigeduankouhao。zaixuanzeduankoushi,wubiyaoquebaotameiyoubeinixitongshangdeqitarenhefuwusuoshiyong,woweifuwuqixuanzeleduankou1977:port 1977

  xiayibu,baocunbingguanbiwenjian,zhongqisshdfuwu。zaiyici,zhuxiaotuichufuwuqizhiqian,jianchayixiashezhi,weicikeyidakailingyigezhongduanchuangkou,ranhoushiyonggaimoshidenglujinqu:ssh -p{port_number}@server_

  shili:

  ssh -p1977

  swapnil@10.14.190.118

黑龙江快乐十分  ruguoninengchenggongdenglujinqu,jiugaodingle。

  wumimadenglu

黑龙江快乐十分  nikeyitongguowumimadenglugengrongyitongguosshjinrudaofuwuqi,bingqiewanquanjinyongmimayanzheng,zengtianlingyicenganquan。wubiyaolaojiyidian:nizhinenggoucongchuangjiansshmiyaodeneitaijiqidenglujinrudaonidefuwuqi。

  bufangshiyongxialiemingling,zaibendixitongshangchuangjiansshmiyao(jiantu3):ssh-keygen - t rsa

930.jpg

黑龙江快乐十分  tu3:chuangjiansshmiyao。

黑龙江快乐十分  tahuitichuyixiewenti;nibuyonggenggaimiyaoweizhi,baoliuqimorenzhi,weitatigongyigenanyicaizhongdetongxingma。xiayibu,nixuyaojiangzheixiemiyaokaobeidaofuwuqishang,neiyangliangtaijiqijiunengshiyongmiyaoyuduifangjinxinglianxile。

  cat ~/.ssh/id_rsa.pub | ssh -p 1977 swapnil@remote-server ";mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

  xianzai,shizheconglingyigezhongduantongguosshjinrudaofuwuqi;yaoshiyiqiezhengchang,tabuhuiyaoqiunishurumima。

  zheiyibuzhuyaoshiweilefangbian,erbushizengtianyixieshishizaizaideanquan。buguoniyekeyizengtianyidiananquan,zhiyaojinyongfuwuqidemimayanzheng。zhixudakaisshdpeizhiwenjian,xunzhaozheizhushideyixing:#passauthentication yes

黑龙江快乐十分  qudiaogaixingzhushi,jiangtacongyesgaichengno。baocunbingguanbiwenjian。ranhou,zhongqisshdfuwu。zaiyici,qiemocongdangqianchuangkouguanbifuwuqilianjie。dakailingyigechuangkou,denglujinrudaofuwuqi(quebaotameiyouyaoqiushurumima)。

黑龙江快乐十分  zheigeshezhidelingyigefangmianzaiyu,nixianzaizhinengcongchuangjiansshmiyaodeneiyitaijiqitongguosshjinrudaofuwuqi。ruguonijingchangcongbutongdejiqidenglujinrudaofuwuqi,qianwanbuyaoshiyongzheiyifangfa。

  zheixieshishituzixingyunxingfuwuqidexinyonghuxuyaokaolvdeyixiejibenfangmian。laojiyidian:heikezongshixianxingyibu;tamenbuduanxunzhaojinerchuangrunifuwuqiderenheloudong。yiner,zuijiashijianjiushiduinidefuwuqizuoyitaoshizhongzuixindebeifen。wojianyinizaiduizhandianzuorenhebianhuaqianhoudouyinggaijinxingbeifen。neiyangyilai,wanyinidefuwuqizhonglezhao,zongshinenggoucongshangyitaobeifenhuifuguolai。



优质网站模板

  • 1
  • 2
  • 3

组网技术文章分类

最新文章推荐

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

组网技术推荐

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10