Skip to Content

Error: User add failed. Cannot add user on this node: FAILED: to establish SSH session

How to solve Error: User add failed. Cannot add user on this node: FAILED: to establish SSH session ?


1. Make sure iptables / firewall is not blocking ssh traffic

Add the following to allow localhost in iptables / firewall

root@gateway:~# iptables -A INPUT -p tcp -s localhost -j ACCEPT
root@gateway :~# csf -a 127.0.0.1

Check if you can ssh " ssh root@localhost "  /  " ssh [email protected] "  (Specify the SSH port with the -p variable if you are using  a custom SSH port)


2. Make sure SSHD is not blocked in /etc/hosts.allow or /etc/hosts.deny

Add the following to allow localhost in /etc/hosts.allow or  /etc/hosts.deny

sshd : localhost : allow


3. If you are using a custom sshd port in your gateway, then make sure its updated under Settings->Miscellaneous->SSH Gateway Port is set to the current SSHD listening port on the ssh gateway  server.

Check your ssh port with the following command 

[root@gateway ~]# cat /etc/ssh/sshd_config | grep Port

# Port 22

#Gateway Ports no


Confirm the sshd configuration step with the following command:

[root@gateway ~]#  grep -v '^\s*#' /etc/ssh/sshd_config | grep -i 'PermitRootLogin\|PubkeyAuthentication\|Port\|PasswordAuthentication'


 4. If you are using a custom SSH port, make sure it is updated under Settings->Miscellaneous->SSH Gateway Port
  

                                                                                                                                                                                                                    Ez version : 7.36.0


Related Article: