我已经使用 cygwin ssh-keygen 生成了 rsa 密钥并将它们复制到服务器
ssh-copy-id -i id_rsa.pub root@my.ip.address
Run Code Online (Sandbox Code Playgroud)
我的 /etc/ssh/sshd_config 文件中有以下设置
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
PermitRootLogin yes
Run Code Online (Sandbox Code Playgroud)
当我ssh root@my.ip.address
仍然提示输入密码时。
下面的输出/usr/sbin/sshd -d
表明在 .ssh/authorized_keys 文件中找到了匹配的密钥,但它仍然需要来自客户端的密码。
我已经阅读了一堆关于文件和目录权限的网络帖子,但没有任何效果。是否可以在 RHEL 6.1 中使用密钥进行 ssh 或这是否被禁止?
ssh 和 sshd 的调试输出如下。
$ ssh -v root@my.ip.address
OpenSSH_6.1p1, OpenSSL 1.0.1c 10 May 2012
debug1: Connecting to my.ip.address [my.ip.address] port 22.
debug1: Connection established.
debug1: identity file /home/dschulze/.ssh/id_rsa type 1
debug1: identity file /home/dschulze/.ssh/id_rsa-cert type -1
debug1: identity file /home/dschulze/.ssh/id_dsa type 2
debug1: …
Run Code Online (Sandbox Code Playgroud)