Server Fault is a question and answer site for system and network administrators. 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 need an automated SSH login method. In Windows, plink has the -pw flag, but it's not supported in OpenSSH.

The "right" way to do it is to use keys authentication, but I'm not interested in these. Instead something much simpler.

I've tried the sshpass package but unfortunately it's not supported in OpenSSH5.8.

Any suggestions.

share|improve this question
I'd reconsider using ssh key authentication - it's actually very simple. Just create an ssh keypair without a password. Then on windows, you can use putty to convert the public key to the putty format and you're practically done. – chrishiestand Mar 2 '11 at 21:38
Use keys. Really. I read your comment to Coops, but really: Use keys. Strongly recommend you rephrase your question to getting keys up and running in your particular environment. – Alex Holst Mar 2 '11 at 21:53
Use keys - you know it makes sense ... – Iain Mar 2 '11 at 22:01
After the initial learning curve of setup, keys will probably turn your connection process into a one-command/one-click process, they're the way to go! – Kzqai Mar 2 '11 at 22:06
up vote 11 down vote accepted

"...use keys authentication, but I'm not interested in these"

Care to elaborate on this? SSH keys are far more powerful than password based logins. Perhaps you need to rethink your approach to the subject as they'll do what you describe easily and SECURELY. Plus they are really quite easy to use.

share|improve this answer
It's not simple as using a switch. You need to create a pair of keys, upload it to the SSH server, connect the SSH server, insert the key to the right place and such. It wouldn't be a problem if it's all about one or two SSH servers, but I'm using quite much, and not always from the same client. I'm going to use it for an automated script. – iTayb Mar 2 '11 at 21:49
@iTaby -- once you get used to keys you'll question why you ever used passwords. They are so elegant and simple. There is no reason a script can't present a key to the remote server rather than a password. If you are interested in serious advise I would recommend using them. They also allow you to have a per-client key, so if a single box gets comprised you can revoke its key. How "simple" do you want! – Coops Mar 2 '11 at 21:57
@iTayb: There's this great command called ssh-copy-id that does the work of deploying your SSH key for you. If you want to deploy to a whole bunch of servers at once (with or without ssh-copy-id, use clusterssh. – MikeyB Mar 2 '11 at 22:18
@iTayb: yes, but it's a lot safer if you disable password authentication. Want proof? Read up on the HBGary incident a few weeks ago ... Aside from that keys are a lot more convenient, no matter whether you use them via agent or simply in a file (when storing without passphrase, use encrypted storage). – 0xC0000022L Mar 3 '11 at 3:44

Keys are the tool OpenSSH provides to accomplish this task. Learn 'em, love 'em.

share|improve this answer

SecureCRT enables you to save password for your session, and I hope it has something like securecrt.exe -load "yourhost" (like putty has)

share|improve this answer

SSH is a way to go. Usability is a matter of automation. Establish a secure (relatively speaking) shared filesystem, and place files there and from each host you could easily automate transfer of keys.

What makes ssh really meaningful and useful are ssh keys. Pass-phrase-less login is another story with keys. As a whole far more secure than passwords.

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.