Quantcast
Channel: THWACK: Message List - Network Configuration Manager
Viewing all articles
Browse latest Browse all 8827

Re: Write a new script to add SSH access to our Cisco gear?

$
0
0

Hi, John.

You can build a script easily for NCM to use that will add SSH, and you can save that script for easy use on future setups.  It's as simple as documenting what you'd do at the command prompt, then pasting it into the Excecute Script area.  For example, in any text editor, put down what you'd use to make SSH active.  Include the "conf t" at the beginning, and "end" and "write mem" at the end.

Example:

Conf t

crypto key generate

rsa

end

write mem

 

Test it first by running it manually on one switch or router and ensure you've done it right.  Then paste it into NCM and save it as a script for future use.

 

Finally, highlight one or more devices in NCM, right click on one and choose Execute Command Script.  Sadly, the exact command won't work on "every" device--you may need more than one scripted command to get SSH on all your boxes.

 

Verify the correct devices are in the top window (you can add or remove devices here, as well).

 

Paste in your script in the bottom window. 

 

Click Execute Command Script

 

You might want to have a backup/failure recovery solution built in, in case you inadvertently cause loss of communications.  In that case, omit the "write mem" command.  Now all you have to do is reboot the box and you're back to running.

 

You can include the "reboot in x minutes" command in the script, which is useful if you don't have someone at the device who can reboot it for you.  Use this when doing small numbers of devices, because you'll want to remote into each one and confirm the config is OK before it reboots automatically.  If it's OK, cancel the "reload in x minutes" command and write mem to make your changes permanent.

 

If you don't write mem and cancel the reload, it'll reboot and you'll lose your new ssh settings.  That can be a good thing if those new settings caused problems.

 

Good networking!


Viewing all articles
Browse latest Browse all 8827

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>