纯小白,想搞免密连接ssh。我整个人都绷不住了,我整了一下午没有都整不明白为什么ssh没有办法用密钥登录,搞到最后发现是密钥文件权限的问题,我把密钥文件权限设成777,但是ssh要求是设要成600否则配置文件中的 RSAAuthentication 选项会被弃用。结果就是ssh登不上去,我就想不明白了为什么权限设多了反到会拒绝身份验证,为什么!一定要600,多了还不行吗?
有没有大佬解释一下这是为什么,真心玩不明白linux...
Spz2022 (2023/07/03 23:10)
GuGuan123, 那好吧
GuGuan123 (2023/07/03 23:08)
Spz2022, 嗨,没必要了,我主要是不知道是什么原因导致无法使用密钥的,现在问题解决了就不需要了。感谢解答我的疑惑
Spz2022 (2023/07/03 23:06)
GuGuan123, 就是卸了你的openssh 并换成dropbear 连接都是一样的
GuGuan123 (2023/07/03 23:04)
Spz2022, 就这样得了吧,不想搞得太复杂。主要是ssh没有报错信息直接让我输密码就很迷,完全不知道是什么原因导致无法使用密钥登录...
Spz2022 (2023/07/03 23:01)
GuGuan123, 如果你不喜欢这样,你可以考虑dropbear
Spz2022 (2023/07/03 22:58)
这是 man ssh的一些信息
~/.ssh/id_rsa
Contains the private key for authentication. These files contain sensitive
data and should be readable by the user but not
accessible by others (read/write/execute). ssh will simply ignore a private
key file if it is
accessible by others. It is possible to specify a
passphrase when generating the key which will be used to encrypt the sensitive
part of this file using 3DES.
~/.ssh/identity.pub
~/.ssh/id_dsa.pub
~/.ssh/id_ecdsa.pub
~/.ssh/id_rsa.pub
Contains the public key for authentication. These files are not sensitive and
can (but need not) be readable by anyone.
来自:
https://stackoverflow.com/questions/9270734/ssh-permissions-are-too-open