ssh连接权限被拒绝(公钥、gssapi密钥、gssapi带麦克风、密码)

ssh连接权限被拒绝(公钥、gssapi密钥、gssapi带麦克风、密码),ssh,rsa,public-key,Ssh,Rsa,Public Key,我在机器a上有一对epadmin的密钥。我通过folder.ssh中的scp在epadmin的主文件夹中的机器B上复制了它们 用于访问的命令:sshepadmin@10.2.11.13 [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

我在机器a上有一对epadmin的密钥。我通过folder.ssh中的scp在epadmin的主文件夹中的机器B上复制了它们

用于访问的命令:sshepadmin@10.2.11.13

[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
这是一段-vverbose日志

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_配置的一部分。我已尝试取消对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

您的问题应该是服务器故障。这是一个基本的问题,或者我应该说有两个:

在服务器端:当您在.ssh目录的epadmin上上载密钥时,您必须在authorized_key中重命名您的id\u rsa\u auto\u epmc.pub文件 在客户端:私钥使用非默认密钥名,因此必须使用-i选项指定密钥路径:ssh-i~/id\u rsa\u auto\u epmc 无需更改密钥身份验证的默认sshd_配置文件。
对于您的问题,最好将您使用的ssh命令行放在终端中以防出错。

解决方案

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

ssh-keygen -f " ~/.ssh/known_hosts" -R xx.xx.xxx.xxx

xx-ip主机

①其中一个dir.ssh应该是0700,.ssh dir及其子文档的作者和组是您的

②授权密钥应为0600或0644


③也许您将公共authorkey内容复制到未运行的授权密钥,现在您可以尝试将authorkey复制到远程主机dir.ssh并重命名授权密钥,是的,您可以尝试!我的英语很差

我试着按照你说的做,并返回sshd\u config,没有任何变化ssh-vv-I/home/epadmin/id\u rsa\u auto\u epmc返回的是什么epadmin@10.2.11.13 ?