问题

首次使用ssh 登录一台新服务器,不能登录,有如下提示:

ssh root@121.36.200.155
The authenticity of host '121.36.200.155 (121.36.200.155)' can't be established.
ECDSA key fingerprint is SHA256:q/G9cz9mMnHHwuJh2rBhU4MhbzlDT2aA6aRdq7N51mE.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '121.36.200.155' (ECDSA) to the list of known hosts.

Authorized users only. All activities may be monitored and reported.
Received disconnect from 121.36.200.155 port 22:2: Too many authentication failures
Disconnected from 121.36.200.155 port 22

解决方法

原因:Since ssh server (sshd) on the remote server expects a particular identity key, the server rejects the connection and ssh client aborts with the above error.

加上-o IdentitiesOnly=yes,即ssh -o IdentitiesOnly=yes root@ip即可登录

参考

How to Fix “SSH Too Many Authentication Failures” Error