Ensure Strong Key Exchange Methods are set for SSH


SSH should be configured with strong key exchange algorithms.


SSH (Secure Shell) is the defacto standard protocol used for remote administration of network devices and Unix servers, providing an encrypted and authenticated alternative to Telnet. However, this ubiquity and requirement to support a wide range of clients and deployment scenarios, as well as SSH's age, mean SSH needs to support a variety of Ciphers of varying strengths.

By default, for the widest range of client compatibility, JUNOS supports SSH Key Exchange using older algorithms and methods such as Diffie-Hellman Group 1 with SHA1.

SSH is a vital tool for administering most JUNOS devices, providing privileged access and potentially transporting sensitive information including passwords. It is recommended that SSH sessions be protected by restricting JUNOS to using stronger Key Exchange methods based on Diffie-Hellman using stronger Elliptic Curve or SHA2 algorithms.


To remove a single insecure Key Exchange method, issue the following command from the [edit system services ssh] hierarchy;

[edit system services ssh]
[email protected]# delete key-exchange <mac name>

If multiple insecure Key Exchange methods were set, it will generally be easier to delete all the Key Exchange method restrictions with the following command:

[edit system services ssh]
[email protected]# delete key-exchange

Once all insecure methods have been removed, add one or more stronger Key Exchange methods (in this example all stronger methods available on most JUNOS devices are set in a single command)

[edit system services ssh]
[email protected]# set key-exchange [ curve25519-sha256 ecdh-sha2-nistp256 ecdh-sha2-nistp384 ecdh-sha2-nistp521 group-exchange-sha2 ]

Finally, single Key Exchange methods or a smaller selection of these more secure methods may be selected on the user's discretion.

[edit system services ssh]
[email protected]# set key-exchange <method>

Default Value:

For most platforms SSH access is enabled by default but key exchange methods are not restricted.

On FIPS releases the curve25519-sha256, dh-group1-sha1, group-exchange-sha & group-exchange-sha2 methods are not supported.

See Also


Item Details


References: 800-53|IA-2(1), CSCv7|11.5

Plugin: Juniper

Control ID: 35bd7180525ddba63ecfbf6a51299a1b35866764719fc535048b3eb99170189a