[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 670
  • Last Modified:

Remotely renaming Host names of Cisco devices

I am renaming Cisco devices remotely and these devices are several hours away if I have to drive over so I would like a confirmation that I am entering the correct commands and not forgetting something?

1.) Open two ssh sessions to each device
2.) reload in 15
3.) "hostname xxxx"
4.) "zeroize rsa key"
5.) "crypto key generate rsa" select a 1024 modulus
6.) Open third session and test ssh connection
7.) wr mem (if third session connects successfully)
8.) reload cancel
9.) show reload
0
Dragon0x40
Asked:
Dragon0x40
  • 5
  • 3
  • 2
3 Solutions
 
SouljaCommented:
Looks good to me.
0
 
Ernie BeekExpertCommented:
As long as you put the reload in first you should be ok. Can't see anything missing in the rest of the commands as well.
0
 
Dragon0x40Author Commented:
Will the reload revert the RSA key to the original also?

The problem with renaming a host is that the RSA key is based on domain and hostname and once the host name is changed the RSA key does not match anymore?

Is the new RSA key stored in running-config only until wr mem?
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Ernie BeekExpertCommented:
I don't think so. If I remember correct the key is saved directly to NVram so a reload won't help.
0
 
SouljaCommented:
Yes, you have to wr mem to keep the key. The key is stored in running-config, but until you wright mem, none of the settings is permanent.
0
 
SouljaCommented:
Enter a sh crypto key mypubkey rsa to show the current running hostname and key.
0
 
Ernie BeekExpertCommented:
Ok, learning every day ;)
0
 
SouljaCommented:
@ erniebeek

As we all are.  ;-)
0
 
Dragon0x40Author Commented:
I was able to rename the devices with no problems.

Used "reload cancel" to cancel reloads and did not have to reboot any of  the devices.

Only step that I would add to my original steps is that when you log in after changing the hostname and the rsa key. You should get a warning saying that the cached rsa key in your ssh client does not match the current rsa key and you should click yes to accept the new rsa key.

If you don't get this message then the rsa key probably did not get changed and you probably won't be able to log in either.

6.) Open third session and test ssh connection (should get prompt rsa key different)
0
 
SouljaCommented:
Great!
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now