cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
529
Views
0
Helpful
1
Replies

Shell Script - How do i extend it to include password for network devices?

I use a very basic shell script to log into network devices from my jumpbox.

For eg. 

$ cat login
ssh -l varun `echo $1`

$ login 10.10.10.1
Enter Password:

I need to manually enter the password everytime. My jumpbox has limited libraries/etc so is there an easy way i can extend the same 'login' script to include my password also?

Additionally, there are times when ssh related questions show up before the password so would love to have them included also to make my life easier. I basically need to say yes to add the fingerprint.

Eg.

$ login 10.10.10.2
The authenticity of host 'router2 (10.10.10.2)' can't be established.
RSA key fingerprint is a0:c5:5e:51:45:f3:4a:21:45:14:c4:67:4a:44:e1:ba.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'router2' (RSA) to the list of known hosts.

Would appreciate any suggestions or pointers but would really prefer to keep it simple like my initial script. This is for daily login and NOT for automation. I have no intent to use this on multiple devices/etc, it is purely for ease of not entering credentials a million times a day

Satisfaction Survey

1 Reply 1

Owens458
Level 1
Level 1

You can configure your network from a device connected to the network box with an ethernet cable.