-1

I made a script recently and have turned it into an app, it basicly logs me into my vps via ssh but I don't know how to tell it how to type in my password for me, heres the code

 tell application "Terminal"
    activate
    do script "ssh root@example.com"
end tell
  • 2
    Use passwordless authentication: debian-administration.org/articles/152 – Gerry Jan 22 '13 at 17:52
  • it didn't work, I probably messed up – surferconor425 Jan 22 '13 at 18:11
  • @surferconor425 It's not that hard to fix, might be a better route to take. I also got it wrong the first few times but it is actually quite easy to get up and running. – BinaryMisfit Jan 22 '13 at 19:01
2

What you want is pretty bad. You should never have a password written in a file. But here is the solution you asked.

tell application "Terminal"
    activate
    do script "ssh root@example.com"
    delay 1
    tell application "System Events"
        keystroke "yourPasswordHere"
        keystroke return
    end tell
end tell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .