ssh免密不成功-比较怪异的一台机器(SSH password free failed – a strange machine)

通常情况下,不需要修改/etc/ssh/sshd_config 这个文件,就可以登录成功。但是就会偶发性存在那么怪异的一台,ssh操作一起正常,就是不成功。

1.检查authorized_keys文件权限,并设置为700

chmod 700 authorized_keys

2.检查/etc/ssh/sshd_config文件

#StrictModes yes

设置为

StrictModes no

#AuthorizedKeysFile .ssh/authorized_keys

设置为

AuthorizedKeysFile .ssh/authorized_keys

3.删除/root/.ssh/known_hosts文件

4.重启ssh

service sshd restart

————————

In general, you do not need to modify / etc / SSH / sshd_ Config file, you can log in successfully. However, there will be such a strange one occasionally. The SSH operation is normal, but it is unsuccessful.

1. Check authorized_ Keys file permission and set it to 700

chmod 700 authorized_keys

2. Check / etc / SSH / sshd_ Config file

take

#StrictModes yes

Set to

StrictModes no

take

#AuthorizedKeysFile .ssh/authorized_keys

Set to

AuthorizedKeysFile .ssh/authorized_keys

3. Delete / root / ssh/known_ Hosts file

4. Restart SSH

service sshd restart