1.新建一个用户,用来登录
# useradd zhangsan (已添加用户名zhangsan为例).
2.设置密码(需要切换到root下进行设置)
# cd /root
# ls
#passwd zhansgan 设置密码
3.修改SSHD配置,禁用root登录
# vi /etc/ssh/sshd_config
找到“PermitRootLogin yes”把后面的yes改成no。
4.重启SSHD服务
#service sshd restart
5.下次登陆的时候先用zhansgan用户登录,然后再切换root用户即可.
以下为切换到root下命令:
# su root 回车会提示输入密码,输入root密码即可切换到root权限