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

Is there a way to automatize SSH connection (so the script could connect without prompting for password) if the server does not allow using keys?

share|improve this question
up vote 5 down vote accepted

if keys are not allowed on the server (which is .. strange) then you want the ssh-client to read the password from stdin .. which brings us to

share|improve this answer
I use personally use "expect", which is the unaccepted answer there. – frabjous Jan 25 '11 at 20:56

You can do this with putty:

For unix, create a file, paste the below command in, chmod 755

putty -ssh ServerNameOrIP -l UserName -pw Password

for windows, you can use vbscript like so:

Dim ShellRun
Set ShellRun = WScript.CreateObject("WScript.Shell")
ShellRun.Run """C:\Program Files\PuTTY\putty.exe"" -ssh ServerNameOrIP -l UserName -pw Password", 1
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.