ssh服务器configuration – input_userauth_request:无效的用户

我有一个问题,configuration我的SSH服务器可以使用公钥login,没有密码。

tail -f /var/log/auth.log给出

Feb 6 14:56:06 ubuntu sshd[24654]: rexec line 26: Deprecated option RhostsAuthentication Feb 6 14:56:28 ubuntu sshd[24654]: Invalid user mpsd from ip.ip.ip.ip Feb 6 14:56:28 ubuntu sshd[24654]: input_userauth_request: invalid user mpsd [preauth] Feb 6 14:56:28 ubuntu sshd[24654]: error: Received disconnect from ip.ip.ip.ip: 14: No supported authentication methods available [preauth] 

我已经检查/home/mpsd/.ssh有700和/home/mpsd/.ssh/authorized_keys有600个权限。 authorized_keys包含我的远程Windows机器上生成的RSA公钥。 我的sshd_config读取

 Port 22 # Use these options to restrict which interfaces/protocols sshd will bind to #ListenAddress :: #ListenAddress 0.0.0.0 Protocol 2 HostKey /etc/ssh/ssh_host_rsa_key HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key UsePrivilegeSeparation yes KeyRegenerationInterval 3600 ServerKeyBits 1024 SyslogFacility AUTH LogLevel INFO LoginGraceTime 120 PermitRootLogin yes StrictModes yes RSAAuthentication yes PubkeyAuthentication yes AuthorizedKeysFile ~/.ssh/authorized_keys # Don't read the user's ~/.rhosts and ~/.shosts files IgnoreRhosts yes RhostsRSAAuthentication no RhostsAuthentication no HostbasedAuthentication no IgnoreUserKnownHosts yes PermitEmptyPasswords yes ChallengeResponseAuthentication no PasswordAuthentication no # Kerberos options #KerberosAuthentication no #KerberosGetAFSToken no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes # GSSAPI options #GSSAPIAuthentication no #GSSAPICleanupCredentials yes X11Forwarding yes X11DisplayOffset 10 PrintMotd no PrintLastLog yes TCPKeepAlive yes #UseLogin no #MaxStartups 10:30:60 #Banner /etc/issue.net # Allow client to pass locale environment variables AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. UsePAM no 

我不知道为什么消息说无效的用户,因为它显然存在。 谢谢你的帮助。

目前你的sshdconfiguration没有启用authentication方法,因此sshd不可能authentication用户。

默认情况下,sshd使用本地PAM设置来authentication用户。 但是,pipe理系统的ssmeone将默认的UsePAM yes更改为UsePAM no 。 简单地还原这个改变。

Fyi:这在RHEL 7中不起作用

将其设置为“yes”以启用PAMauthentication,帐户处理和会话处理。 如果启用了,则通过ChallengeResponseAuthentication和PasswordAuthentication允许PAMauthentication。 根据您的PAMconfiguration,通过ChallengeResponseAuthentication的PAMauthentication可以绕过“PermitRootLogin without-password”的设置。 如果您只是希望PAM帐户和会话检查在没有PAMauthentication的情况下运行,那么启用它,但将PasswordAuthentication和ChallengeResponseAuthentication设置为“no”。 警告:红帽企业版Linux不支持“UsePAM no”,可能会导致一些问题。