09-18-2025 03:13 AM - edited 09-18-2025 03:16 AM
hi,
our cisco nexus switch got flagged for using a "weak" SSH key.
previous admin probably forgot to generate the "proper" SSH/RSA 2048 bit key.
can i do this remotely change this on the fly? meaning, i generate a new SSH/RSA 2048 bit key without losing my SSH session?
or do i temporarily enable "feature telnet", telnet to nexus switch, generate SSH 2048 bit key, then disable telnet?
SW# sh ssh server
ssh version 2 is enabled
SW# sh ssh key
**************************************
rsa Keys generated:Thu Apr 7 05:12:15 2005
ssh-rsa AAAAB3NzaCxxx
bitcount:1024
fingerprint:
SW(config)# crypto key generate rsa label Switch modulus ?
<512-2048> Key-pair size
(config)# feature t?
tacacs+ Enable/Disable tacacs+
telnet Enable/Disable telnet
Solved! Go to Solution.
09-18-2025 11:15 PM
Hello @johnlloyd_13
You can generate a new RSA key on your nexus remotely over SSH without dropping your current session. The change only affect new conection; the existing session stays active.
09-18-2025 03:26 AM
i suggest to do this command in the Lan or come console. (to be safe side)
most case that should work remotely, (enable telnet or any other method to connect ) while changing.
some time we cutting our own branch..
09-18-2025 03:35 AM
I do this remotely with Catalyst switches. Never tried with Nexus but the situation should be the same as Catalyst switches and routers.
09-18-2025 01:35 PM - edited 09-18-2025 01:44 PM
isn't the key used for initiating the SSH session?
after the key exchange and subsequesnt phase are complete and the session is established it will remain active and you can
- generate a new key
- test the key by initiating a second session keeping the current session active to make corrections if needed.
09-18-2025 11:15 PM
Hello @johnlloyd_13
You can generate a new RSA key on your nexus remotely over SSH without dropping your current session. The change only affect new conection; the existing session stays active.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide