ssh 连接报错:Permission denied (publickey).

我的情况是,准备用ssh-copy-id拷贝root公钥到另一台服务器上,但另一台只允许通过公钥登录,所以会报如上错误,ssh-copy-id是通过密码验证来拷贝的,具体解决办法:

PasswordAuthentication no -> yes

在这之前先保证有公钥文件,如果没有通过ssh-keygen创建

发布了85 篇原创文章 · 获赞 39 · 访问量 11万+
展开阅读全文

ssh登陆“Permission denied ”是怎么回事?

07-19

ssh登陆服务器,输入密码后却一直不能登陆进去,输出的调试信息是: ``` wangxiaoxiaodeMacBook-Air:.ssh wangxiaoxiao$ ssh -v -p 1029 xxwang@115.156.164.251 OpenSSH_6.9p1, LibreSSL 2.1.8 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 21: Applying options for * debug1: Connecting to 115.156.164.251 [115.156.164.251] port 1029. debug1: Connection established. debug1: identity file /Users/wangxiaoxiao/.ssh/id_rsa type 1 debug1: key_load_public: No such file or directory debug1: identity file /Users/wangxiaoxiao/.ssh/id_rsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/wangxiaoxiao/.ssh/id_dsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/wangxiaoxiao/.ssh/id_dsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/wangxiaoxiao/.ssh/id_ecdsa type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/wangxiaoxiao/.ssh/id_ecdsa-cert type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/wangxiaoxiao/.ssh/id_ed25519 type -1 debug1: key_load_public: No such file or directory debug1: identity file /Users/wangxiaoxiao/.ssh/id_ed25519-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_6.9 debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x04000000 debug1: Authenticating to 115.156.164.251:1029 as 'xxwang' debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: Server host key: ecdsa-sha2-nistp256 SHA256:hEan0tTVdOIgIhYZnv9cee++XRQXxts3RWehu5+cDis debug1: Host '[115.156.164.251]:1029' is known and matches the ECDSA host key. debug1: Found key in /Users/wangxiaoxiao/.ssh/known_hosts:1 debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: SSH2_MSG_SERVICE_REQUEST sent debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,password debug1: Next authentication method: publickey debug1: Offering RSA public key: /Users/wangxiaoxiao/.ssh/id_rsa debug1: Authentications that can continue: publickey,password debug1: Trying private key: /Users/wangxiaoxiao/.ssh/id_dsa debug1: Trying private key: /Users/wangxiaoxiao/.ssh/id_ecdsa debug1: Trying private key: /Users/wangxiaoxiao/.ssh/id_ed25519 debug1: Next authentication method: password xxwang@115.156.164.251's password: debug1: Authentications that can continue: publickey,password Permission denied, please try again. xxwang@115.156.164.251's password: debug1: Authentications that can continue: publickey,password Permission denied, please try again. xxwang@115.156.164.251's password: debug1: Authentications that can continue: publickey,password debug1: No more authentication methods to try. Permission denied (publickey,password).``` ``` 然后我谷歌了一下,按照网上的方法,把.ssh删了,再重新ssh-keygen重新生成,后再ssh,依然存在这个同样的问题? 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览