.. _dellemc.enterprise_sonic.sonic_ssh_module: ********************************** dellemc.enterprise_sonic.sonic_ssh ********************************** **Manage SSH configurations on SONiC** Version added: 3.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - This module provides SSH configuration management to specify the algorithms used for SSH connection in devices running SONiC. Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
config
dictionary
SSH clients and servers use the following configurations for SSH connections.
client
dictionary
SSH client configuration
cipher
string
Cipher algorithm used in SSH connection for encryption. When configured, this value is used by SSH clients which communicate with the server.
Specify as a comma separated list.
Options are aes128-ctr, aes192-ctr, aes256-ctr
chacha20-poly1305@openssh.com, aes128-gcm@openssh.com
and aes256-gcm@openssh.com
kex
string
KEX algorithm used in SSH connection for key exchange. When configured, this value is used by SSH clients which communicate with the server.
Specify as a comma separated list.
Options are curve25519-sha256, curve25519-sha256@libssh.org
ecdh-sha2-nistp256, ecdh-sha2-nistp384, ecdh-sha2-nistp521,
diffie-hellman-group-exchange-sha256,
diffie-hellman-group16-sha512,
diffie-hellman-group18-sha512 and
diffie-hellman-group14-sha256
mac
string
MAC algorithm used in SSH connection for generating and verifying Message Authentication Codes. When configured, this value is used by SSH clients which communicate with the server.
Specify as a comma separated list.
Options are umac-128-etm@openssh.com,
hmac-sha2-256-etm@openssh.com,
hmac-sha2-512-etm@openssh.com, umac-128@openssh.com,
hmac-sha2-256 and hmac-sha2-512
state
string
    Choices:
  • merged ←
  • deleted
  • replaced
  • overridden
The state specifies the type of configuration update to be performed on the device.
If the state is "merged", merge specified attributes with existing configured attributes.
For "deleted", delete the specified attributes from existing configuration.
For "replaced", replace on-device SSH configuration with the specified configuration.
For "overridden", override on-device SSH configurations with the specified configuration.

Notes ----- .. note:: - Tested against Enterprise SONiC Distribution by Dell Technologies. - Supports ``check_mode``. Examples -------- .. code-block:: yaml # Using "deleted" state # # Before state: # ------------- # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client ciphers aes192-ctr,chacha20-poly1305@openssh.com # ip ssh client macs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512 # sonic# - name: Delete specified SSH configurations dellemc.enterprise_sonic.sonic_ssh: config: client: cipher: 'aes192-ctr,chacha20-poly1305@openssh.com' mac: 'umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com' state: deleted # After state: # ------------ # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512 # sonic# # Using "deleted" state # # Before state: # ------------- # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client ciphers aes192-ctr,chacha20-poly1305@openssh.com # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512 # ip ssh client macs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com # sonic# - name: Delete all SSH configurations dellemc.enterprise_sonic.sonic_ssh: config: state: deleted # After state: # ------------ # # sonic# show running-configuration | grep "ip ssh client" # (No "ip ssh client" configuration present) # sonic# # Using "merged" state # # Before state: # ------------- # # sonic# show running-configuration | grep "ip ssh client" # sonic # (No "ip ssh client" configuration present) - name: Modify SSH configurations dellemc.enterprise_sonic.sonic_ssh: config: client: cipher: 'aes192-ctr,chacha20-poly1305@openssh.com' mac: 'umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com' kex: 'curve25519-sha256,diffie-hellman-group16-sha512' state: merged # After state: # ------------ # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client ciphers aes192-ctr,chacha20-poly1305@openssh.com # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512 # ip ssh client macs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com # sonic# # Using "replaced" state # # Before state: # ------------- # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client ciphers aes192-ctr,chacha20-poly1305@openssh.com # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512 # ip ssh client macs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com # sonic# - name: Modify SSH configurations dellemc.enterprise_sonic.sonic_ssh: config: client: cipher: 'aes256-ctr' kex: 'curve25519-sha256,diffie-hellman-group16-sha512' state: replaced # After state: # ------------ # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client ciphers aes256-ctr # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512 # sonic# # Using "overridden" state # # Before state: # ------------- # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client ciphers aes192-ctr,chacha20-poly1305@openssh.com # ip ssh client kexalgorithms curve25519-sha256,diffie-hellman-group16-sha512 # ip ssh client macs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com # sonic# - name: Modify SSH configurations dellemc.enterprise_sonic.sonic_ssh: config: client: cipher: 'aes256-ctr' mac: 'umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com' state: overridden # After state: # ------------ # # sonic# show running-configuration | grep "ip ssh client" # ip ssh client ciphers aes256-ctr # ip ssh client macs umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com # sonic# Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
dictionary
when changed
The resulting configuration model invocation.

Sample:
The configuration returned will always be in the same format as the parameters above.
after_generated
dictionary
when check_mode
The generated configuration from module invocation.

Sample:
The configuration returned will always be in the same format as the parameters above.
before
dictionary
always
The configuration prior to the model invocation.

Sample:
The configuration returned will always be in the same format as the parameters above.
commands
list
always
The set of commands pushed to the remote device.

Sample:
['command 1', 'command 2', 'command 3']


Status ------ Authors ~~~~~~~ - Balasubramaniam Koundappa(@balasubramaniam-k)