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 


Overview: This article addresses issues when adding users fails due to SSH session establishment problems. Steps include checking firewall settings to allow localhost SSH traffic, ensuring SSHD isn't blocked in hosts.allow or hosts.deny, verifying SSH gateway port configurations, and updating settings if using a custom SSH port.



Step 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)

Step 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

Step 3. If you are using a custom SSHD port on your gateway, make sure it is updated under Settings -> Miscellaneous -> SSH Gateway Port to reflect the current SSHD listening port on the SSH gateway server.

Also 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'


Related Article