I have this basic script file.sh
that connects to a server
name=username
routerip=172.21.200.37
echo "$name""@""$routerip"
ssh "$name""@""$routerip"
sample output:
$ ./file.sh
username@172.21.200.37
username@172.21.200.37's password:
What I am wondering is how to best handle the password that is requested in my script. Should I use expect
? Or is there another way. Also if the password is in the script should it be encrypted for security?
And maybe a silly question but, is there a way to connect to the server with haveing a username?