Description

Customers may be unable to access an SRX device via SSH after an upgrade or configuration change because the SSH service is configured to use a non-default port instead of port 22.

Symptoms

-SSH access fails when using default port 22.

Error such as:

  • Connection refused
  • Connection timed out

Device is reachable via:

  • Ping
  • HTTPS / J-Web
  • Console access

No SSH-related failure seen in logs when attempting connection on port 22

SSH works only when specifying an alternate port (if known).

Solution

The SRX device is configured with a custom SSH port (e.g., 2121), and the user is attempting to connect using the default port (22).

Example configuration:


system {

   services {

       ssh {

           port 2121;

       }

   }

}


Verify SSH port:

1.Access the device via console or alternate method and run:


show configuration system services ssh


Verify port if it is set to 22 or some other value.


port <value>;


→ SSH is listening on that custom port

If no port is defined → default is 22


Use the Correct Port


ssh -p <custom-port> user@<device-ip>


eg: ssh -p 2121 [email protected]


where, x.x.x.x is SRX IP address.


-Revert to Default Port (Optional)

If required, remove the custom port configuration:

delete system services ssh port

commit


Note:

Always document any custom management port changes

Validate SSH configuration after upgrades

Ensure firewall filters explicitly allow the configured SSH port

Use standard port 22 unless there is a specific requirement


Modification History

2026-06-15 : Article Created