关于libssh2,登陆失败Authentication by password failed

wjm_nefu 2018-02-11 06:44:03
主机升级ssh后,原来好使的项目就不能正常使用了,报错“Response exception,,Authentication by password failed”,但是实际情况不是密码问题,调试正常输出用户名和密码都是正常的,但是在主机上直接ssh user@x.x.x.x 就能成功。

失败的syslog
Feb 11 18:28:51 jfapp1 sshd[19843]: SSH: Server;Ltype: Version;Remote: 133.224.218.33-51415;Protocol: 2.0;Client: libssh2_1.8.0
Feb 11 18:28:51 jfapp1 sshd[19843]: SSH: Server;Ltype: Kex;Remote: 133.224.218.33-51415;Enc: aes128-ctr;MAC: hmac-sha2-256;Comp: none [preauth]
Feb 11 18:28:51 jfapp1 sshd[19843]: SSH: Server;Ltype: Authname;Remote: 133.224.218.33-51415;Name: drecv1 [preauth]

成功的syslog
Feb 11 18:29:46 jfapp1 sshd[25964]: SSH: Server;Ltype: Version;Remote: 133.224.218.35-53441;Protocol: 2.0;Client: OpenSSH_7.3p1+sftpfilecontrol-v1.3-hpn14v11
Feb 11 18:29:46 jfapp1 sshd[25964]: SSH: Server;Ltype: Kex;Remote: 133.224.218.35-53441;Enc: chacha20-poly1305@openssh.com;MAC: <implicit>;Comp: none [preauth]
Feb 11 18:29:46 jfapp1 sshd[25964]: SSH: Server;Ltype: Authname;Remote: 133.224.218.35-53441;Name: drecv1 [preauth]
Accepted keyboard-interactive/pam for drecv1 from 133.224.218.35 port 53441 ssh2

之前正常使用的版本:
[/opt/openssl/lib/hpux64]$ssh -V
OpenSSH_6.2p1+sftpfilecontrol-v1.3-hpn13v12, OpenSSL 0.9.8o 01 Jun 2010
HP-UX Secure Shell-A.06.20.006, HP-UX Secure Shell version
升级后不能正常使用的版本:
[/drecvdata/drecv1]$ssh -V
OpenSSH_7.3p1+sftpfilecontrol-v1.3-hpn14v11, OpenSSL 1.0.2k 26 Jan 2017
HP-UX Secure Shell-A.07.30.003, HP-UX Secure Shell version
...全文
1111 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
ocean放飞 2018-11-29
  • 打赏
  • 举报
回复
这个问题我也遇到过,后来研究了下,是较新版本的ssh的 sshd_config 设置了不允许密码登陆,修改了就可以了。 # To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes
wjm_nefu 2018-02-11
  • 打赏
  • 举报
回复
后台的失败日志: 2018-02-11 18:28:50.883 6959:2 taskexec-[Information] received request,publishNodeId=1609261000071345,execId=1802111800096636,operType=0,staffId=LUANHB2,extra= 2018-02-11 18:28:50.953 6959:2 taskexec-[Information] ssh2 to 133.224.218.31:22,user=drecv1,passwd=Drecv_1204,execCmd:shellapp -n1609261000071345 -f1802111800096636 -p0 -oLUANHB2 2018-02-11 18:28:50.953 6959:2 taskexec-[Debug] ssh2 connect to remote host... 2018-02-11 18:28:51.253 6959:2 taskexec-[Debug] ssh2 ssh2_open_session111 2018-02-11 18:28:51.254 6959:2 taskexec-[Error] Response exception,,Authentication by password failed.

18,771

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧