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.


Synopsis: This article will help the gateway users to 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 below command to display the shell in use.

root@server:~# finger <username> 

              or

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

Step 2: Use below command to change the shell

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