Authentication by ssh key failed
How to solve Authentication by SSH key failed in Ezeelogin?
Overview: This article helps in resolving the "Authentication by SSH key failed/Authentication by password failed" error that occurs in the backend(ezsh) when logging into a remote server.
Step 1: Make sure that you can manually SSH to the remote server from the Ezeelogin gateway server.
root@gateway:~# ssh user@remoteserver_ip or hostname
Step 2: Verify the password has been entered correctly from Ezeelogin GUI and backend(ezsh). Refer below screenshots.
Step 2(A): To view password from backend(ezsh), ssh into the jump server, select the server whose password needs to be viewed, and press the tab key.
Step 3: While adding the server using a key, Make sure that the key is correct and does not contain any strange characters or space while copy-pasting.
Step 4: Check the error log of the remote server to which you are trying to login.
For Centos:
root@remote_server:~# /var/log/secure
For Ubuntu:
root@remote_server:~# /var/log/auth.log
For other OS:
root@remote_server:~# journalctl -u sshd or journalctl -u ssh
Step 5: Check if password and key based auth enabled in remote server.
root@remote_server:~# sshd -T | grep -i 'PubkeyAuthentication\|PasswordAuthentication'
pubkeyauthentication yes
passwordauthentication yes
Solution: If password or key based authentication is not enabled, enable it on the remote server to resolve the issue.
Step 6: Check if specific user or user group if allowed in sshd_config file.
root@remote_server:~# sshd -T | grep -i 'AllowUsers\|AllowGroups'
allowusers root
allowusers alex
allowgroups ezuser
Solution: Add the username or user group to the SSHD configuration file if it is not already allowed to resolve the issue.
Step 7: Check the error logs
Related Articles: