Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Remotely renaming Host names of Cisco devices

Posted on 2011-09-15
10
Medium Priority
?
667 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
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!

 
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Hello to you all, I hear of many people congratulate AWS (Amazon Web Services) on how easy it is to spin up and create new EC2 (Elastic Compute Cloud) instances, but then fail and struggle to connect to them using simple tools such as SSH (Secure…
If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
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

636 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