【发布时间】:2013-12-01 02:18:22
【问题描述】:
最近,我遇到了 ssh 远程主机的问题。
首先,当 /etc/ssh/sshd_config 文件中的“PasswordAuthentication”参数为“yes”时,我可以 ssh 远程主机。
但是,在 /etc/ssh/sshd_config 文件中将“PasswordAuthentication”参数更改为“no”后,我无法 ssh 远程主机。
我知道我的问题是关于 PublicKey,因为我的 /etc/ssh/sshd_config 文件中有这些参数:
RSAAuthentication yes
PubkeyAuthentication yes
PermitRootLogin yes
“# ssh root@172.17.4.17 -VVV”的结果是这样的,
debug1: Server host key: RSA 8a:bb:7f:d0:61:69:cc:b2:a1:a0:16:be:52:c1:5c:94
debug3: load_hostkeys: loading entries for host "172.17.4.17" from file "/home/jundu/.ssh/known_hosts"
debug3: load_hostkeys: found key type RSA in file /home/jundu/.ssh/known_hosts:12
debug3: load_hostkeys: loaded 1 keys
debug1: Host '172.17.4.17' is known and matches the RSA host key.
debug1: Found key in /home/jundu/.ssh/known_hosts:12
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/jundu/.ssh/id_rsa ((nil))
debug2: key: /home/jundu/.ssh/id_dsa ((nil))
debug2: key: /home/jundu/.ssh/id_ecdsa ((nil))
debug1: Authentications that can continue: publickey
debug3: start over, passed a different list publickey
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /home/jundu/.ssh/id_rsa
debug3: no such identity: /home/jundu/.ssh/id_rsa
debug1: Trying private key: /home/jundu/.ssh/id_dsa
debug3: no such identity: /home/jundu/.ssh/id_dsa
debug1: Trying private key: /home/jundu/.ssh/id_ecdsa
debug3: no such identity: /home/jundu/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
权限被拒绝(公钥)?我只是不知道这是什么意思。谁能给我一些建议?提前谢谢!
【问题讨论】:
-
看起来服务器只想让您使用公钥,而您没有公钥。
标签: public-key openssh