Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

iBroken

macrumors newbie
Original poster
Jul 17, 2011
27
0
Hi

i've to connect to some servers through SSH daily, and every server has his IP and user and pass,and this is how i connect to SSH {xxx=ip}

open Terminal :

# ssh root@xxx.xx.xxx.xxx
# root@xxx.xx.xxx.xxx's password: { then i've to write the password here}

what i wanna ask about is how to make the script write the password ? i know its n00b question but i'm new to this and the whole Mac :D

here's my "too Long" script :p

PHP:
tell application "Terminal"
	do script "ssh root@xxx.xx.xxx.xxx"
end tell

thanks
 
A more secure solution is to use public key authentication along with ssh-agent (or gpg-agent). You start an instance of ssh-agent, attach keys to it and then you can login without being continually prompted for passwords. You won't have to hardcode your password into the script.

crackpip
 
Login:password@xxx.xxx

where exactly i should write this :( , sorry i'm new to this

A more secure solution is to use public key authentication along with ssh-agent (or gpg-agent). You start an instance of ssh-agent, attach keys to it and then you can login without being continually prompted for passwords. You won't have to hardcode your password into the script.

crackpip

sounds too complicated for me :D
 
You type it where you typed it the first time: after the SSH. Just add :password before the @.

you mean like FTP URL ? if you don't want to be asked about the user and pass you write

PHP:
ssh user:pass@xx.xx.xx.xx

. ??? i tried that before i open this thread but its not working, cuz the SSH will consider it as part of the user :)
 
Last edited:
A more secure solution is to use public key authentication along with ssh-agent (or gpg-agent). You start an instance of ssh-agent, attach keys to it and then you can login without being continually prompted for passwords. You won't have to hardcode your password into the script.

crackpip

thank you for telling me about this method cuz i googled it and did it :) now i don't need to type passwords anymore :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.