小编Dea*_*lze的帖子

在 RHEL 6.1 上,以 root 身份使用公钥的 SSH 仍会提示输入密码

我已经使用 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)

remote-access ssh ssh-keygen ssh-keys rhel6

1
推荐指数
1
解决办法
3万
查看次数

标签 统计

remote-access ×1

rhel6 ×1

ssh ×1

ssh-keygen ×1

ssh-keys ×1