Results 1 to 7 of 7
Hello,
I have created .sh file to login into remote server by using following;
# vi vpn.sh
ssh rootatremoteserverip
then I run sh vpn.sh and it asks password for this ...
- 02-22-2011 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 5
Creating .sh
Hello,
I have created .sh file to login into remote server by using following;
# vi vpn.sh
ssh rootatremoteserverip
then I run sh vpn.sh and it asks password for this server, I want to put the password also in the script so that when I type sh vpn.sh then it won't ask password.
Any ideas.
______
Regards,
Ali
- 02-22-2011 #2
yes.
- use ssh authorized keys
- do not remote login as root
You must always face the curtain with a bow.
- 02-22-2011 #3Just Joined!
- Join Date
- Jan 2010
- Posts
- 5
- 02-22-2011 #4
ok, if authorized keys login is already setup, then you might want to look into ssh-agent.
The idea is, that you give the passphrase just once (per session).You must always face the curtain with a bow.
- 02-22-2011 #5
You cannot script an ssh session with a shell script.
You should use expect
Manpage of EXPECT
- 02-23-2011 #6Linux Engineer
- Join Date
- Feb 2005
- Posts
- 1,044
- 02-23-2011 #7The private key can and should be protected with a passphrase.I'm confused. When I use authorized keys my connection between my computer and the remote host is trusted and doesn't require a password - I thought that was the point of authorized keys?
Otherwise anyone with that file can access your servers.
But you dont want to type that passphrase all the time.
This is where the ssh-agent comes in.You must always face the curtain with a bow.


Reply With Quote
