Client is unable to log in to an EX switch using SSH or Telnet.
When a client is trying to connect to an EX switch using Telnet or SSH, it might fail with the following error:
ssh_exchange_identification: Connection closed by remote host
There could be several reasons for this behavior; for example, missing or empty directory under /var/ , an RSA key not being generated, etc.
/var/
The following are some possible troubleshooting steps:
Make sure that SSH or Telnet is configured on the EX. If not, configure it using the following commands and commit:
#set system services ssh #set system services telnet
Check the logs messages for the following error: empty directory missing in /var .
empty directory missing in /var
If you see this message, create a directory named “empty” by using following commands:
>start shell user root : Password : ----enter root password--- - % cd /var - % mkdir empty
Try again. If it still does not work, a new RSA and keygen might need to be generated. Regenerate the RSA and DSA keys for SSH with the following commands:
>start shell user root % ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
You will see this message:
Generating public/private dsa key pair. /etc/ssh/ssh_host_dsa_key already exists. Overwrite (y/n)? >>>select yes %ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key Generating public/private dsa key pair. /etc/ssh/ssh_host_dsa_key already exists. Overwrite (y/n)? >>>select yes
If the issue persists, open a case with your technical support representative.
2020-03-27: Article reviewed for accuracy; no changes required.