SSH报错Unable to authenticate | version mismatch

A error: Unable to authenticate

The client has disconnected from the server. Reason:Unable to authenticate using any of the configured authentication methods.

Meaning 无法进行身份验证, the error message is vague, can not be determined immediately, the investigation may be the following reasons:

  1. SSH client does not open password authentication

  2. Or SSH server does not allow password authentication

  3. It is also possible that SSH Keys errors (lost / damaged / mismatched)

Terminal SSH connection change

Did it because I had been using SecureCRT normal connection, only recently began to report this error, it is likely to be a local connection data SecureCRT is a problem, but you can rule out switching to Terminal connection problem.

# Connection SSH 
$ 22 -p SSH root @ IP


If you login login input appears, then determine SecureCRT problem, this time by simply deleting SecureCRT in the re-establishment of a connection can be resolved. If there is no problem login continue to look down.

Confirm SSH configuration

Examination /etc/ssh/sshd_config of the  PasswordAuthentication yesremoved comments, save, restart the ssh service sshd restartservice: .

Try connecting again, if the error disappear, resolved, otherwise continue below.

Because access is denied

Log Server Viewauth.log

cat auth.log
15 11:20:24 hp06 sshd[31533]: Authentication refused: bad ownership or modes for file /home/user/.ssh/authorized_keys


Solution: chmod 600  /home/user/.ssh/authorized_keysHere come according to your log.

SSH certificate does not match

This is generally not the reason, but if the above methods are useless, you need the pemcertificate into pubthe certificate, and manually specify the path to solve the problem.

Error two: Protocol version mismatch

The client has disconnected from the server. Reason: Protocol version mismatch. Required protocol version is 1.3 - 1.99. Received version was 2.0.

Tip is clear is 连接协议版本不匹配, the solution modified to SSH2 on the line:

QQ screenshot 20200319182716.png

Guess you like

Origin blog.51cto.com/sf1314/2480150
Recommended