Disable root 账号登陆

来源:互联网 发布:淘宝联盟首页 编辑:程序博客网 时间:2024/05/01 14:54

1. 修改文件: /etc/ssh/sshd_config

 #PermitRootLogin yes

 修改为:

 PermitRootLogin no

 

2. 重启ssh进程

/etc/init.d/sshd restart
Stopping sshd:                    [  OK  ]
Starting sshd:                    [  OK  ]


TIPS:

  • 用root账号登陆时,如果只看到井号,输入bash,就可以正常显示,登陆账号,主机名,家目录。

   # bash
   [root@hostname ~]#
ls -lart

  • kill -9  0 登陆服务器后,用此命令, history命令,将不会记录你的操作。够酷吧。大笑
4 0
原创粉丝点击