Description

SSH is program to open a connection between a local router or switch and a remote system and execute commands on the remote system. You can issue the ssh command from the Junos OS CLI to log in to a remote system or from a remote system to log in to the local router or switch.

This KB provides steps to resolve common issues associated to SSH on JUNOS

Symptoms

Possible issues:

  • Unable to connect to the switch through SSH.
  • Console is working and all the ports are up and passing traffic without any issues.
  • Devices are reachable through ping. 
  • SSH connections drop intermittently 

Solution

The following steps assist resolving SSH issues on JUNIPER devices:

 

 

 

  • If using TACAS try different username or using root credentials

 

  • If not working for Root access try adding: set system services ssh root-login allow

 

  • Try pinging different IPs on the switch before using SSH. If the IP is unreachable, check if the interface is UP and routing is correct (show route, show interface terse, show arp no-resolve)

 

  • Check if any filter is blocking SSH and modify the filters accordingly. Try deactivating filters temporarily as well.

 

 

  •  Check for ZTP default phone-home configuration "system services home-phone" and delete this line.

 

  • Delete, commit and readd the SSH configuration to allow new Keys to be regenerated.

 

  • Regenerate the RSA and DSA keys for SSH manually 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

  • Try a reboot

Modification History

1. Modified Title

2.gporrascontre - re arranged the steps on a more efficient way and added 3 extra steps