System Security Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

PDF

System Security Configuration Guide for Cisco 8000 Series Routers, IOS XR Releases

Configure an OpenSSH client for multiplexing

Want to summarize with AI?

Log in

Configures an OpenSSH client to reuse a primary authenticated SSH connection for later service sessions to the same remote server.


Reduce connection setup and repeated authentication for concurrent SSH operations.

Before you begin

Use an OpenSSH client and ensure that the client configuration directory exists.

Procedure

  1. Open the system or user SSH client configuration file.

    The system file is located under /etc/ssh/ssh_config. The user file is located under ~/.ssh/config or $HOME/.ssh/config.

  2. Add a host rule that creates or reuses a primary connection.

    Example:

    Host *
        ControlMaster auto
        ControlPath ~/.ssh/tmp/%r@%h:%p

    ControlMaster auto creates a primary session when one does not exist. ControlPath identifies its control socket.

  3. Create the directory specified by ControlPath and save the client configuration.

    Protect the directory so that only the intended user can access its control sockets.

Later SSH operations to a matching server reuse the primary connection when its control socket is available.


SSH cipher and HMAC controls

An SSH algorithm control is a security configuration that

  • sets the client or server cipher preference list

  • removes selected HMAC algorithms from negotiation, and

  • permits deprecated CBC or 3DES ciphers only when explicitly enabled and supported.


Supported SSH encryption algorithms

Use this list when constructing an SSH client or server cipher preference.

The source lists these algorithms in preference order:

  • aes128-ctr

  • aes192-ctr

  • aes256-ctr

  • aes128-gcm@openssh.com

  • aes256-gcm@openssh.com

  • aes128-cbc

  • aes192-cbc

  • aes256-cbc

  • 3des-cbc

CTR and GCM ciphers are enabled by default. CBC and 3DES ciphers are disabled by default and are not supported by CiscoSSH as documented in its implementation restrictions.


Caution: Avoid deprecated SSH algorithms

Enable a deprecated SSH algorithm only when a required peer cannot negotiate a supported stronger algorithm.

This caution applies to client and server commands that expose CBC or 3DES cipher families.

Deprecated algorithms provide weaker protection and can increase exposure to cryptographic attacks. CiscoSSH also rejects unsupported algorithm-only configurations.

Prefer CTR or GCM ciphers and remove deprecated algorithms after the compatibility requirement ends.


Disable an SSH HMAC algorithm

Prevent negotiation of an HMAC algorithm that does not meet the deployment security policy.

Procedure

  1. Disable the HMAC algorithm on the SSH server and client, and commit the configuration.

    Example:

    Router# configure
    Router(config)# ssh server disable hmac hmac-sha1
    Router(config)# commit
    Router(config)# ssh client disable hmac hmac-sha1
    Router(config)# commit
  2. Verify the SSH configuration.

    Example:

    Router# show running-config ssh

The SSH client and server no longer offer the disabled HMAC algorithm.


Configure SSH cipher algorithms

Control the ciphers that an SSH client and server can use during connection negotiation.

Before you begin

Confirm that each selected cipher is supported by the SSH implementation and operating mode. Use deprecated CBC and 3DES ciphers only when they are required and supported.

Procedure

  1. Enter global configuration mode on Router 1 and Router 2.

    Example:

    Router# configure
  2. Select one of the following cipher configurations and apply the corresponding commands.

    • To enable all listed ciphers on the client and server, configure:

      Router 1:
      Router(config)# ssh client algorithms cipher aes256-cbc aes256-ctr aes192-ctr aes192-cbc aes128-ctr aes128-cbc aes128-gcm@openssh.com aes256-gcm@openssh.com 3des-cbc
      
      Router 2:
      Router(config)# ssh server algorithms cipher aes256-cbc aes256-ctr aes192-ctr aes192-cbc aes128-ctr aes128-cbc aes128-gcm@openssh.com aes256-gcm@openssh.com 3des-cbc
    • To enable CTR ciphers on the client and CBC and 3DES ciphers on the server, configure:

      Router 1:
      Router(config)# ssh client algorithms cipher aes128-ctr aes192-ctr aes256-ctr
      
      Router 2:
      Router(config)# ssh server algorithms cipher aes128-cbc aes256-cbc aes192-cbc 3des-cbc
    • To remove the explicitly configured cipher lists from the client and server, configure:

      Router 1:
      Router(config)# no ssh client algorithms cipher
      
      Router 2:
      Router(config)# no ssh server algorithms cipher
    • To configure only deprecated CBC and 3DES ciphers on the client and server, configure:

      Router 1:
      Router(config)# ssh client algorithms cipher aes128-cbc aes192-cbc aes256-cbc 3des-cbc
      
      Router 2:
      Router(config)# ssh server algorithms cipher aes128-cbc aes192-cbc aes256-cbc 3des-cbc
    • To explicitly enable deprecated CBC and 3DES cipher families and configure CTR ciphers on the client and server, configure:

      Router 1:
      Router(config)# ssh client enable cipher aes-cbc 3des-cbc
      Router(config)# ssh client algorithms cipher aes128-ctr aes192-ctr aes256-ctr
      
      Router 2:
      Router(config)# ssh server enable cipher aes-cbc 3des-cbc
      Router(config)# ssh server algorithms cipher aes128-ctr aes192-ctr aes256-ctr
  3. Commit the configuration on each router.

    Example:

    Router(config)# commit
  4. Verify the configured cipher lists in the running configuration.

    Example:

    Router# show running-config ssh

    When all listed ciphers are enabled, the running configuration contains:

    Router 1:
    ssh client algorithms cipher aes256-cbc aes256-ctr aes192-ctr aes192-cbc aes128-ctr aes128-cbc aes128-gcm@openssh.com aes256-gcm@openssh.com 3des-cbc
    !
    
    Router 2:
    ssh server algorithms cipher aes256-cbc aes256-ctr aes192-ctr aes192-cbc aes128-ctr aes128-cbc aes128-gcm@openssh.com aes256-gcm@openssh.com 3des-cbc
    !

The SSH client and server use their configured cipher lists during algorithm negotiation.