I am new to SW and was hoping if some can help me create a script that will query the database and configure SSH on all of my devices.
Thanks!!!
You will first need to make sure of three basic things before you can run the script you want.
1. The device already has a device name.
2. The device has a domain-name specified. (If not, I have included it in my example)
3. The device's IOS will support SSH (Not all Cisco IOS's support SSH, especially the older ones), if the "crypto" command is not recognized in "conf t" mode then the IOS probably doesn't support it and you'll have to upgrade the IOS if you want SSH on it.
The script I created recently to do this exact same process was:
config t!ip domain-name whatever.com!crypto key generate rsa!512!line vty 0 15!transport input ssh!end!wr mem!
You can put the domain-name you want your device(s) to have where whatever.com is above, the 512 can also be changed (its the size of the RSA key) all the way up to 2048. Now if you are wanting a script to just force SSH input only on your device & you have already generated the SSH keys prior the script could be like this:
config t!line vty 0 15!transport input ssh!end!wr mem!
Hope that helps!