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.

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

2 Answers 2

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

http://stackoverflow.com/questions/1340366/how-to-make-ssh-receive-the-password-from-stdin

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

 
discard

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.