?
Solved

Remotely renaming Host names of Cisco devices

Posted on 2011-09-15
10
Medium Priority
?
661 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
10 Comments
 
LVL 26

Assisted Solution

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

Accepted Solution

by:
Ernie Beek earned 668 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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 1332 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
 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Arrow Electronics was searching for a KVM  (Keyboard/Video/Mouse) switch that could display on one single monitor the current status of all units being tested on the rack.
In this article, we’ll look at how to deploy ProxySQL.
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…
Suggested Courses

752 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