Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[Junos] SSH connection refused due to missing of sshd_conf file



Article ID: KB34078 KB Last Updated: 20 May 2019Version: 1.0

Router refused to accept SSH connection with an error message, "connection refused".  When all of the necessary configuration is present, this issue may be caused by a missing config file for sshd process.


When the user tries to connect to the router via SSH, a "RST" packet is seen instead of "SYN, ACK" from the router, followed by a "connection refused" message on the console.

  1. Checked the basic configuration, if SSH is allowed on this router for that user.

  2. Restarted the sshd process, which did not clear the issue.

  3. Went to the file system and discovered there is a missing file.

In Junos, when starting /usr/sbin/sshd process from shell, if you are not missing any folders, it will start. Otherwise, it will return the error message shown below:

In this case, it returned missing "/var/etc//sshd_conf"

labroot@test-re0> start shell

root@test-re0% /usr/sbin/sshd

/var/etc//sshd_conf: No such file or directory. <-- Missing file

Expected file contents in a working scenario:

Subsystem netconf /usr/libexec/ui/netconf
PermitRootLogin yes

The solution is to delete the ssh configuration on the router and reapply it back to get the sshd_conf contents pushed once again.

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search