我在机器A上有一对密钥到epadmin。我通过文件夹中的scp
将它们复制到epadmin主文件夹中的机器B上.ssh
访问命令:ssh [email protected]
[epadmin@3A1D .ssh]$ ls -la
total 24
drwxrwxr-x 2 epadmin epadmin 4096 May 12 14:41 .
drwx------ 6 epadmin epadmin 4096 May 12 14:40 ..
-rw-r--r-- 1 epadmin epadmin 438 May 12 14:41 config
-rw------- 1 epadmin epadmin 1671 May 12 14:41 id_rsa_auto_epmc
-rw-r--r-- 1 epadmin epadmin 407 May 12 14:41 id_rsa_auto_epmc.pub
-rw-r--r-- 1 epadmin epadmin 2818 May 12 14:41 known_hosts
这是一段-vvv(详细)日志
debug1: Next authentication method: publickey
debug1: Trying private key: /home/epadmin/.ssh/identity
debug3: no such identity: /home/epadmin/.ssh/identity
debug1: Trying private key: /home/epadmin/.ssh/id_rsa
debug3: no such identity: /home/epadmin/.ssh/id_rsa
debug1: Trying private key: /home/epadmin/.ssh/id_dsa
debug3: no such identity: /home/epadmin/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug3: packet_send2: adding 64 (len 52 padlen 12 extra_pad 64)
没有密码我无法登录
一块sshd_config。我试图取消注释RSAAut并将no粘贴到密码auth。没有变化
# Authentication:
#RSAAuthentication yes
#PubkeyAuthentication yes
#AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedKeysCommand none
#AuthorizedKeysCommandRunAs nobody
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no
# similar for protocol version 2
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# RhostsRSAAuthentication and HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
# To disable tunneled clear text passwords, change to no here!
#PasswordAuthentication yes
#PermitEmptyPasswords no
PasswordAuthentication yes
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
ChallengeResponseAuthentication no
您的问题应该是服务器故障。这是一个基本的麻烦,或者我应该说两个:
默认sshd_config文件不需要进行任何更改以进行密钥身份验证。对于您的问题,最好放置您使用的ssh命令行。
在终端中解决错误
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
ssh-keygen -f " ~/.ssh/known_hosts" -R xx.xx.xxx.xxx
xx - ip主机
①你的目录.ssh应该是0700而.ssh目录和他的儿子文件的作者和团体是你的
②enified_keys应为0600或0644
③你可以将公共authorkey内容复制到authorized_keys不运行,现在你可以尝试将authorkey复制到远程主机你的dir .ssh并重命名authorized_keys,是的,你可以尝试一下!我的英语很差