当试图ssh -v“一些主机”
Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: /home/kaldown/.ssh/id_rsa debug1: Authentications that can continue: publickey debug1: Trying private key: /home/kaldown/.ssh/id_dsa debug1: Trying private key: /home/kaldown/.ssh/id_ecdsa debug1: Trying private key: /home/kaldown/.ssh/id_ed25519 debug1: No more authentication methods to try. Permission denied (publickey).
为什么他说这是1型,而不是2型
debug1: identity file /home/kaldown/.ssh/id_rsa type 1 debug1: identity file /home/kaldown/.ssh/id_rsa-cert type -1 debug1: identity file /home/kaldown/.ssh/id_dsa type -1 debug1: identity file /home/kaldown/.ssh/id_dsa-cert type -1 debug1: identity file /home/kaldown/.ssh/id_ecdsa type -1 debug1: identity file /home/kaldown/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/kaldown/.ssh/id_ed25519 type -1 debug1: identity file /home/kaldown/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.6.1_hpn13v11 FreeBSD-20140420
在sshd_config中:
PermitRootLogin no RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys PermitEmptyPasswords no PasswordAuthentication no ChallengeResponseAuthentication no GSSAPIAuthentication no UsePAM yes UsePrivilegeSeparation sandbox
PS我使用的是FreeBSD 10.1,它有一个ssh-copy-id的问题,讲的很奇怪
Unmatched '
所以我只是scp我的公钥在确切的用户.ssh / authorized_keys
1)为什么它使用.ssh / id_rsa而不是.ssh / id_rsa.pub作为公钥?
2)为什么它告诉我,types1,当我用ssh -t rsa(rsa2)键创build这个
3)为什么我不能连接的密钥,但密码只有该configuration。
服务器端:CentOS 7,3.10
谢谢。
您的id_rsa文件包含有关您的私钥和公钥的信息。 它只是提供关键的公共部分。
我认为types1或types2指定它是RSA还是DSA密钥。
sshd_config是为服务器,所以这就是你说的在这个文件中查找公钥,以确保它匹配您的客户端发送的私钥。
服务器上的公钥进入〜/ .ssh / authorized_keys
然后客户端发送私钥在〜/ .ssh / id_rsa中,服务器将它们匹配起来并允许你进入
客户端在这里设置
[[email protected] /etc/ssh]# grep IdentityFile /etc/ssh/ssh_config # IdentityFile ~/.ssh/identity # IdentityFile ~/.ssh/id_rsa # IdentityFile ~/.ssh/id_dsa
这些评论也意味着它们是客户端的默认值。
如果你想发送一个不同的密钥,你可以随时做
ssh -i /path/to/key/file [email protected]
restorecon -r -vv /home/user/.ssh
将解决问题。
在这里find