Solved

Remotely renaming Host names of Cisco devices

Posted on 2011-09-15
10
652 Views
Last Modified: 2012-05-12
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
Comment
Question by:Dragon0x40
  • 5
  • 3
  • 2
10 Comments
 
LVL 26

Assisted Solution

by:Soulja
Soulja earned 333 total points
ID: 36544233
Looks good to me.
0
 
LVL 35

Accepted Solution

by:
Ernie Beek earned 167 total points
ID: 36545032
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
 

Author Comment

by:Dragon0x40
ID: 36545768
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
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 36545822
I don't think so. If I remember correct the key is saved directly to NVram so a reload won't help.
0
 
LVL 26

Assisted Solution

by:Soulja
Soulja earned 333 total points
ID: 36545827
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 26

Expert Comment

by:Soulja
ID: 36545840
Enter a sh crypto key mypubkey rsa to show the current running hostname and key.
0
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 36547754
Ok, learning every day ;)
0
 
LVL 26

Expert Comment

by:Soulja
ID: 36549445
@ erniebeek

As we all are.  ;-)
0
 

Author Comment

by:Dragon0x40
ID: 36555483
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
 
LVL 26

Expert Comment

by:Soulja
ID: 36556578
Great!
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

Problem Description:   Couple of months ago we upgraded the ADSL line at our branch office from Home to Business line. The purpose of transforming the service to have static public IP’s. We were in need for public IP’s to publish our web resour…
Getting hacked is no longer a matter or "if you get hacked" — the 2016 cyber threat landscape is now titled "when you get hacked." When it happens — will you be proactive, or reactive?
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now