Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
    
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

1 Answer 1

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

This site is currently not accepting new answers.

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