简体   繁体   English

ssh 连接权限被拒绝(公钥、gssapi-keyex、gssapi-with-mic、密码)

[英]ssh connect Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)

I have a pair of keys to epadmin on machine A. I copied them on machine B in home folder of epadmin via scp in folder .ssh我在机器 A 上有一对 epadmin 的密钥。我通过文件夹 .ssh 中的scp将它们复制到机器 B 上的 epadmin 主文件夹中

command for access : ssh epadmin@10.2.11.13访问命令:ssh epadmin@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

Here is a piece of -vvv(Verbose) log这是一段 -vvv(Verbose) 日志

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)

I can't login without password没有密码我无法登录

Piece of sshd_config. sshd_config 的一部分。 I have tried to uncomment RSAAut and paste no to password auth.我试图取消对 RSAAut 的注释并将 no 粘贴到密码验证中。 There were no changes没有变化

# 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

Your question should be on server fault.您的问题应该是服务器故障。 It's a basic trouble or I should say two :这是一个基本的麻烦,或者我应该说两个:

  • on the server side : when you upload your keys on epadmin in your .ssh directory, you have to rename your id_rsa_auto_epmc.pub file in authorized_keys在服务器端:当您在 .ssh 目录中的 epadmin 上上传您的密钥时,您必须在 authorized_keys 中重命名您的 id_rsa_auto_epmc.pub 文件
  • on the client side : you use a non-default key name for your private key so you have to specify the path to your key by using -i option : ssh -i ~/id_rsa_auto_epmc在客户端:您为私钥使用非默认密钥名称,因此您必须使用 -i 选项指定密钥的路径:ssh -i ~/id_rsa_auto_epmc

No changes is needed to default sshd_config file for key authentification.无需更改用于密钥认证的默认 sshd_config 文件。 For your question, it should be better to put the ssh command line you use.对于您的问题,最好将您使用的 ssh 命令行。

Solution in terminal for error在终端解决错误

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

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

xx - ip host xx - ip 主机

①one your dir .ssh should be 0700 and the .ssh dir and his son documents's author and group is yours ①你的目录.ssh应该是0700,.ssh目录和他儿子文档的作者和组是你的

②the authorized_keys should be 0600 or 0644 ②authorized_keys 应该是 0600 或 0644

③maybe you copy the public authorkey content to authorized_keys isn't run, now you can try copy the authorkey to the remote host your dir .ssh and rename authorized_keys , yeah you can try it! ③也许你复制公共authorkey内容到authorized_keys没有运行,现在你可以尝试将authorkey复制到远程主机你的目录.ssh并重命名authorized_keys,是的,你可以试试! poor English my be run可怜的英语我跑了

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Git权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic)? - Git Permission denied (publickey,gssapi-keyex,gssapi-with-mic)? 错误权限被拒绝(公钥、gssapi-keyex、gssapi-with-mic) - ERROR Permission denied (publickey, gssapi-keyex, gssapi-with-mic) OpenShift中的权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic) - Permission denied (publickey,gssapi-keyex,gssapi-with-mic) in OpenShift 问题:权限被拒绝(publickey、gssapi-keyex、gssapi-with-mic) - Problem: Permission denied (publickey,gssapi-keyex,gssapi-with-mic) 无法再SSH到EC2实例:权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic) - Cannot ssh into EC2 instance anymore: Permission denied (publickey,gssapi-keyex,gssapi-with-mic) ssh到Google Cloud的权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic) - ssh to google cloud Permission denied (publickey,gssapi-keyex,gssapi-with-mic) EC2 ssh 权限被拒绝(公钥、gssapi-keyex、gssapi-with-mic) - EC2 ssh Permission denied (publickey,gssapi-keyex,gssapi-with-mic) 无法通过ubuntu中的配置文件将ssh连接到ec2。 权限被拒绝(公钥,gssapi-keyex,gssapi-with-mic) - Unable to connect ssh to ec2 through config file in ubuntu. Permission denied (publickey,gssapi-keyex,gssapi-with-mic) SSH 无密码:martin@XXX.XXX.XXX.XXX:权限被拒绝(publickey、gssapi-keyex、gssapi-with-mic) - SSH Without Password: martin@XXX.XXX.XXX.XXX: Permission denied (publickey,gssapi-keyex,gssapi-with-mic) 无法连接到 EC2 实例并出现错误,权限被拒绝 (publickey,gssapi-keyex,gssapi-with-mic) - Unable to connect to EC2 instance with error, Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM