TEL:
linux下开启SSH,并且允许root用户远程登录
| 发布时间: 2019-03-14 19:41:01 | 1432 次浏览
linux下开启SSH,并且允许root用户远程登录

一、开启ssh配置服务


编辑ssh配置文件

  #vi /etc/ssh/sshd_config

在/etc/ssh/sshd_config最后中加入

PermitRootLogin yes #允许root登录
PermitEmptyPasswords no #不允许空密码登录
PasswordAuthentication yes # 设置是否使用口令验证。

修改完配置文件后,重新启动sshd服务器(/etc/rc.d/sshd restart)即可。


补充:

1. 如果重启后还是不行, 请重新载入sshd_config 文件

/etc/rc.d/sshd reload

2. 如果出现using keyboard-interactive authentication
password:
请确认配置文件中,PasswordAuthentication参数值是否已经改成yes
另外如果客户端是putty, 那么请确认”尝试’智能键盘’认证(SSH-2)”的勾是否有去掉!!!!
3. 如果是使用root帐号登陆
请确认密码是否为空
空密码无法登陆
4. 请确认是否有安装SSH
确认sysinstall>>>configure>>>networking>>>sshd是否的勾是否有打上.



二、问题与解决

ssh client 报 algorithm negotiation failed的解决方法之一

修改sshd的配置文件 /etc/ssh/sshd_config

在配置文件中添加:

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc

MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org

重启sshd服务后,即可正常连接。

导致此问题的原因是ssh升级后,为了安全,默认不再采用原来一些加密算法,我们手工添加进去即可