Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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"
    do script "ssh"
end tell
share|improve this question
Use passwordless authentication: – 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

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"
    do script "ssh"
    delay 1
    tell application "System Events"
        keystroke "yourPasswordHere"
        keystroke return
    end tell
end tell
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.