Linux -- 使用root用户远程登录
1. 设置root密码$ sudo passwd root根据提示输入密码2. 切换到root用户$ su - root根据提示输入密码3. 编辑 sshd_config# vi/etc/ssh/sshd_config原配置(是否注释和yes/no不一定完全配)#PermitRootLogin yesPasswordAuthentication no修改后:PermitRootLogin yesP
·
1. 设置root密码
$ sudo passwd root
根据提示输入密码
2. 切换到root用户
$ su - root
根据提示输入密码
3. 编辑 sshd_config
# vi /etc/ssh/sshd_config
原配置(我这是centos7的默认配置)
#PermitRootLogin yes
PasswordAuthentication no
修改后:
PermitRootLogin yes
PasswordAuthentication yes
4.重启sshd服务
service sshd restart
或
systemctl restart sshd.service
本文出现任何错误,请留言批评指正。
更多推荐
已为社区贡献1条内容
所有评论(0)