Skip to Content

Error: Server login failed. Authentication by SSH key failed!. Remote Error: (1) if: Expression Syntax..

How to solve Error: Server login failed. Authentication by SSH key failed!. Remote Error: (1) if: Expression Syntax?


Overview: This article will help the gateway users resolve the error "Error: Server login failed. Authentication by SSH key failed!. Remote Error: (1) if: Expression Syntax." 


Step 1: Make sure the ssh user is using the bash shell. Run the below command to display the shell in use.

root@remoteserver:~# finger <username

              or

root@remoteserver:~# grep <username> /etc/passwd

Step 2: Run the below command to change the shell.

root@remoteserver:~# chsh -s /bin/bash <username>


Related Articles:

Error log file and configuration file to troubleshoot.