Configuring the SSH service by using the command line

You can configure the SSH service by using the config and ssh commands on the command line.

About this task

You configure the SSH service, and can then optionally go on to configure the ciphers that the SSH service uses. By default the service uses 16 ciphers in a recommended order. You can, if required, disable or re-enable certain ciphers and reorder them.

Procedure

  1. Enter the configuration mode by entering the following command:
    config
    
  2. Specify the IP address and port that the SSH service listens on by entering the following command:
    ssh IPAddress:Port
    
    where:
    IPAddress
    Specifies the IP address of the Ethernet interface that you want to use to access the SSH service.
    port
    Specifies the port number that you want to use to access the SSH service.
  3. Exit the configuration mode by entering the following command:
    exit
    
  4. To work with SSH ciphers and host key algorithms, enter the crypto SSH server mode by entering the following commands:
    crypto
    sshserverprofile
  5. Enter the following command to change the enabled ciphers and the order of preference that they are used in:
    ciphers <cipher_string>
    Where cipher_string lists the enabled ciphers in the required preference order. See ciphers for the names of ciphers that you can specify in the string.
  6. Enter the following command to specify the supported host key algorithms (by default, all are selected):
    host-key-alg <algorithm>
    Where algorithmspecifies the SSH host key algorithms to support. See host-key-alg for a list of algorithms.
  7. Exit the configuration mode by entering the following command:
    exit
    
  8. Exit the crypto mode by entering the following command:
    exit