一、修改sshd_config
vi /etc/ssh/sshd_config
二、去掉注释,修改文件内容为
PasswordAuthentication yes
PermitRootLogin yes
三、重启sshd
service sshd restart
四、用root登录测试
ssh root@127.0.0.1
五、xshell连接
① 在系统中查看ip地址
ip a
② 配置好服务器ip、账号密码连接即可
注:
如果出现问题:
① /etc/ssh/ssh_config: line 54: Bad configuration option: permitrootlogin
说明改错文件了,不是ssh_config(客户端)而是sshd_config(服务器)
② 如果未设置root密码,则需要设置root密码
passwd root
该文指导如何修改Linux系统的sshd_config文件,启用PasswordAuthentication和PermitRootLogin,然后重启sshd服务。接着,测试root用户通过SSH连接本地服务器,并提示注意检查是否改错文件以及确保root有密码。最后,说明如何使用xshell连接服务器,需知服务器IP和账号密码。

2774

被折叠的 条评论
为什么被折叠?



