ZoeGreenn 2016-07-19 07:01 采纳率: 0%
浏览 11245
已结题

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

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,依然存在这个同样的问题?

  • 写回答

2条回答 默认 最新

  • jxplus 2016-07-19 07:13
    关注

    携带密码登录的话,用sshpass命令;
    免密码登陆的话,需要将你本机的公钥复制到服务器文件中,即将本机的~/.ssh/id_rsa.pub文件的内容加到 服务器的~/.ssh/authorized_keys文件中。

    你用ssh命令,应该是免密码登陆。

    评论

报告相同问题?

悬赏问题

  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64
  • ¥15 iOS 自定义输入法-第三方输入法
  • ¥15 很想要一个很好的答案或提示
  • ¥15 扫描项目中发现AndroidOS.Agent、Android/SmsThief.LI!tr
  • ¥15 怀疑手机被监控,请问怎么解决和防止
  • ¥15 Qt下使用tcp获取数据的详细操作
  • ¥15 idea右下角设置编码是灰色的
  • ¥15 全志H618ROM新增分区