首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >ssh连接权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic,password)

ssh连接权限被拒绝(publickey,gssapi-keyex,gssapi-with-mic,password)
EN

Stack Overflow用户
提问于 2014-05-12 21:01:10
回答 2查看 46.7K关注 0票数 2

我在计算机A上有一对epadmin的密钥。我通过文件夹.ssh中的scp将它们复制到计算机B的epadmin主文件夹中

访问命令: ssh epadmin@10.2.11.13

代码语言:javascript
复制
[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(详细)日志

代码语言:javascript
复制
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粘贴到password auth。没有任何变化

代码语言:javascript
复制
# 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
EN

回答 2

Stack Overflow用户

发布于 2015-12-01 23:00:14

终端中错误的解决方案

代码语言:javascript
复制
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

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

xx - ip主机

票数 -1
EN

Stack Overflow用户

发布于 2018-01-18 19:11:40

1dir .ssh应该是0700,.ssh目录及其子文档的作者和组就是您的了

2 authorized_keys应为0600或0644

3也许你复制公共授权密钥内容到authorized_keys没有运行,现在你可以尝试复制授权密钥到远程主机你的目录.ssh并重命名authorized_keys,是的,你可以尝试一下!可怜的英语可以跑了

票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23609819

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档