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
Dragon0x40Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Soulja53 6F 75 6C 6A 61 Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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
Soulja53 6F 75 6C 6A 61 Commented:
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
Soulja53 6F 75 6C 6A 61 Commented:
Enter a sh crypto key mypubkey rsa to show the current running hostname and key.
0
Ernie BeekExpertCommented:
Ok, learning every day ;)
0
Soulja53 6F 75 6C 6A 61 Commented:
@ 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
Soulja53 6F 75 6C 6A 61 Commented:
Great!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Routers

From novice to tech pro — start learning today.