Skip to content

SSH

SSH server configuration for NX-OS devices. This section controls SSH protocol settings including ciphers, key exchange algorithms, message authentication codes, login behavior, and host key generation. SSH requires the ssh feature to be enabled.

NameTypeConstraintMandatoryDefault Value
devicesListdevicesNo
device_groupsListdevice_groupsNo
globalClassglobalNo
templatesListtemplatesNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
configurationClassconfigurationNo

NameTypeConstraintMandatoryDefault Value
systemClasssystemNo

NameTypeConstraintMandatoryDefault Value
sshClasssshNo
ip_ssh_source_interfacesListip_ssh_source_interfacesNo

NameTypeConstraintMandatoryDefault Value
sshClasssshNo

NameTypeConstraintMandatoryDefault Value
ciphers_allBooleantrue, falseNo
ciphers_weakBooleantrue, falseNo
kexalgos_allBooleantrue, falseNo
keytypes_allBooleantrue, falseNo
login_attemptsIntegermin: 1, max: 10No
login_gracetimeIntegermin: 0, max: 3600No
macs_allBooleantrue, falseNo
portIntegermin: 22, max: 65535No
keysListkeysNo

ip_ssh_source_interfaces (nxos.devices.configuration.system)

Section titled “ip_ssh_source_interfaces (nxos.devices.configuration.system)”
NameTypeConstraintMandatoryDefault Value
vrfStringYes
source_interface_typeChoiceethernet, loopback, mgmt, port-channel, vlan, vniNo
source_interface_idAnyString or Integer[min: 0]No

keys (nxos.devices.configuration.system.ssh)

Section titled “keys (nxos.devices.configuration.system.ssh)”
NameTypeConstraintMandatoryDefault Value
typeChoicersa, dsa, ecdsaYes
key_lengthIntegermin: 0, max: 4096No

Example 1: Basic SSH hardening with weak ciphers disabled

nxos:
devices:
- name: LEAF1
configuration:
system:
ssh:
ciphers_weak: false
login_attempts: 3
login_gracetime: 60

Example 2: SSH with custom port and key generation

nxos:
devices:
- name: LEAF1
configuration:
system:
ssh:
port: 2222
login_attempts: 3
login_gracetime: 120
keys:
- type: rsa
key_length: 2048
- type: ecdsa
key_length: 256

Example 3: Full SSH hardening configuration

nxos:
devices:
- name: LEAF1
configuration:
system:
ssh:
ciphers_all: true
ciphers_weak: false
kexalgos_all: true
keytypes_all: true
macs_all: true
login_attempts: 3
login_gracetime: 60
port: 22
keys:
- type: rsa
key_length: 2048
- type: ecdsa
key_length: 521

Example 4: SSH source-interface per VRF (ip ssh source-interface <intf> vrf <vrf>)

nxos:
devices:
- name: LEAF1
configuration:
system:
ip_ssh_source_interfaces:
- vrf: management
source_interface_type: mgmt
source_interface_id: 0
- vrf: default
source_interface_type: loopback
source_interface_id: 0

Example 1: Basic SSH hardening with weak ciphers disabled

nxos:
devices:
- name: LEAF1
configuration:
system:
ssh:
ciphers_weak: false
login_attempts: 3
login_gracetime: 60

Example 2: SSH with custom port and key generation

nxos:
devices:
- name: LEAF1
configuration:
system:
ssh:
port: 2222
login_attempts: 3
login_gracetime: 120
keys:
- type: rsa
key_length: 2048
- type: ecdsa
key_length: 256

Example 3: Full SSH hardening configuration

nxos:
devices:
- name: LEAF1
configuration:
system:
ssh:
ciphers_all: true
ciphers_weak: false
kexalgos_all: true
keytypes_all: true
macs_all: true
login_attempts: 3
login_gracetime: 60
port: 22
keys:
- type: rsa
key_length: 2048
- type: ecdsa
key_length: 521