紧急求助:ssh登录时提示permission denied please try again
说明几点:
用户名和密码都是root,不存在密码错误,因为就是用root 账户登录的,无法登录成功。
防火墙(iptables)没有开启。
sshd已经开启。
[root@OK2440 /root]# ps | grep sshd
942 root 3812 S /usr/local/sbin/sshd
按照网上的说法,修改/etc/ssh/sshd_config文件,设置如下:
PasswordAuthentication yes
PermitRootLogin yes
UsePrivilegeSeparation no
但仍然没有解决问题。
清除/root/.ssh/known_hosts(rm –f /root/.ssh/known_hosts)也不行。
更改root 账户密码,重启sshd。不报permission denied please try again,但是报Your password has expired. You must change your password now and login again!
192.168.0.15是我自己板子的ip地址,是可以ping通的。
实在找不到原因,急切等待答案,求大侠们帮忙解决一下这个小问题。
下面是我的具体操作以及调试信息。
/usr/local/bin/ssh -v 192.168.0.15
OpenSSH_4.7p1, OpenSSL 1.0.0d 8 Feb 2011
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Connecting to 192.168.0.15 [192.168.0.15] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7
debug1: match: OpenSSH_4.7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
The authenticity of host '192.168.0.15 (192.168.0.15)' can't be established.
RSA key fingerprint is fd:9f:c7:78:af:1f:e1:82:ee:ca:59:af:8b:21:46:b6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.15' (RSA) to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
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,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
root@192.168.0.15's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
root@192.168.0.15's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
root@192.168.0.15's password:
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,password,keyboard-interactive).
[root@OK2440 .ssh]# /usr/local/bin/ssh -vv 192.168.0.15
OpenSSH_4.7p1, OpenSSL 1.0.0d 8 Feb 2011
debug1: Reading configuration data /usr/local/etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to 192.168.0.15 [192.168.0.15] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type -1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7
debug1: match: OpenSSH_4.7 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.7
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 115/256
debug2: bits set: 549/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug2: no key of type 0 for host 192.168.0.15
debug2: no key of type 2 for host 192.168.0.15
The authenticity of host '192.168.0.15 (192.168.0.15)' can't be established.
RSA key fingerprint is fd:9f:c7:78:af:1f:e1:82:ee:ca:59:af:8b:21:46:b6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.15' (RSA) to the list of known hosts.
debug2: bits set: 514/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /root/.ssh/identity ((nil))
debug2: key: /root/.ssh/id_rsa ((nil))
debug2: key: /root/.ssh/id_dsa ((nil))
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: Next authentication method: password
root@192.168.0.15's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
root@192.168.0.15's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
Permission denied, please try again.
root@192.168.0.15's password:
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,password,keyboard-interactive).
相关推荐
Git-Permission_Denied-PublicKey.docx
附件是在使用Git过程中遇到的Permission Denied Publickey的问题,之前把该问题组织成一个文档了。
FreeBSD SSH密钥认证实战:从生成到VS Code无缝连接
SSH密钥认证是一种基于非对称加密的身份验证机制,其核心原理是用私钥签名、公钥验签,实现‘拥有即授权’的安全模型。相比密码认证,它天然抵御暴力破解、中间人窃听和重放攻击,显著提升远程访问安全性。在类Unix系统中,OpenSSH是主流实现,而FreeBSD因其严格的权限校验(strict mode)、默认禁用ssh-copy-id、单文件sshd_config策略等特性,使密钥配置更易出错但也更可控。本文聚焦FreeBSD 15.1环境,详解rsa 4096密钥生成、authorized_keys手动部署、
CentOS 7 SSH密钥登录实战:Ed25519配置、SELinux修复与VSCode/Git全链路打通
SSH密钥认证是Linux服务器身份验证的基础安全机制,其核心原理是基于非对称加密的数字签名验证,替代脆弱的密码认证。相比传统密码,密钥具备不可伪造性、行为可追溯性及抗暴力破解能力,技术价值在于构建零信任访问基线。典型应用场景包括远程开发(如VSCode Remote-SSH)、自动化运维(Ansible)、代码托管(Git over SSH)及内网服务器安全加固。在CentOS 7环境中,必须特别关注Ed25519算法选型优势及其与SELinux上下文的深度耦合——`restorecon -Rv ~/.s
普通用户不能su切换到其它用户提示killed,或者无法登录系统
root用户无法su切换到其它用户,提示killed 普通用户无法su切换到其它用户,提示Authentication is denied 普通用户根本无法登录系统等。 除检查/etc/security/下文件外
ubuntu16.04下使用idea时,上传自建git库是遇到的问题(Permission Denied (publickey)和)及解决
git clone 出现Permission Denied (publickey)问题,大多数博主建议大家加入公钥,不过加入公钥以后还是有问题。我自己出现的问题有两个: 1、sign_and_send_pubkey: signing failed: agent refused operation 2、可以使用git push origin master:master推送成功,但是使用idea直接在git选项下推送还是报Permission Denied (publickey)。 可能下面提到的解决方法不是最简单的解决办法,但是我经过亲测后,能够解决上面的问题。 解决方法如下: 1、ssh-ke


系统维护与使用区
