Change default SSH Port Cisco Nexus NX-OS

With Cisco NX-OS from version 9.2(1) you can change the default SSH port.

Follow these steps to change the SSH port to 58002:

# configure terminal
(config)# ip access-list copp-system-acl-ssh
(config-acl)#30 permit tcp any any eq 58002
(config-acl)#40 permit tcp any eq 58002 any
(config-acl)# exit
(config)#ssh port 58002

Now you can connect to SSH via the new custom port 58002.

To see the available port range that you can choose a port number from, use this command :

# show sockets local-port-range

Then you can optionally disable port 22 from the copp-system-acl-ssh access list as follows:

# config terminal
(config)# ip access-list copp-system-acl-ssh
(config-acl)# no 10 permit tcp any any eq 22
(config-acl)# no 20 permit tcp any eq 22 any
(config-acl)# exit

Finally copy running-config to startup-config to save the changes permanently.

# copy r s

Done!