Received disconnect from host: 2: Too many authentication failures for username

root@linux:~ # ssh emerson@
Received disconnect from 2: Too many authentication failures for emerson

The problem was that my server tried to authenticate using a method and then gave up.

To fix it, edit file /etc/ssh/sshd_config and increase MaxAuthTries. On my server was just trying 1 time.

root@linux:~ # vi /etc/ssh/sshd_config
#MaxAuthTries 1

You can try to not use ssh keys to login but I commented the parameter to restore the default value and restarted the sshd service

root@linux:~ # service sshd restart
Stopping sshd: [ OK ]
Starting sshd: [ OK ]

%d bloggers like this: