SSH 设置好密钥登录之后无法免密登录 / SSH Needs STILL Password to Login After Seting RSA-KEY

All the configuration could be found in 

man sshd

and the related description is

Lists the public keys (DSA, ECDSA, Ed25519, RSA) that can be used for logging in
as this user. The format of this file is described above. The content of the
file is not highly sensitive, but the recommended permissions are read/write for
the user, and not accessible by others.

If this file, the ~/.ssh directory, or the user's home directory are writable by
other users, then the file could be modified or replaced by unauthorized users.
In this case, sshd will not allow it to be used unless the StrictModes option has
been set to "no".

Make sure your home directory can not be modified by anyone else,

sudo chmod go-w ~

and modify permission for ssh related files (not sure for exactly but it works),

sudo chmod 700 ~/.ssh

sudo chmod 600 ~/.ssh/*

If that does not work as expected, or you want the permission of your home folder more open

set StrictModes to no form yes in /etc/ssh/sshd_config

 

posted @ 2020-08-13 14:23  TerranceL  阅读(94)  评论(0编辑  收藏  举报