Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 want to automate this SSH tunneling command on OS X.

ssh -D port account@server

The shell will prompt you to enter the password.

Is it possible to automate it with something like The Automator? any solution is welcomed.

share|improve this question
What part do you want automated? The whole thing end to end, or do you just not want to be prompted for your password? – Nathan Powell Jul 21 '11 at 0:58
The whole thing. I'm looking for automation that supply the password by itself (yes hard coded). – Chiron Jul 21 '11 at 1:19

The best way to automatically create an SSH tunnel is to set up a public/private key pair - that way you can authenticate without a password.

There are some good instructions here. It even gives an example of using the SSH connection in a Perl script - although you can use a Bash script or Automator's "Run shell script" action if you'd rather. You can ignore most of the parameters to ssh-keygen - it'll prompt you for those that are required.

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.