tags:

views:

42

answers:

3

hi all,

how can i pass the password along with the scp command.when we use the scp protocol, it prompts us for the password.But i want to pass it as a parameter.Is that possible without using the key generation techniques?

A: 

you have to use public/private key authentication. on ubuntu this works like described here: https://help.ubuntu.com/community/SSH/OpenSSH/Keys

note: other -nix flavors should work in a similar.

udo
yeah but i don't want to use ssh keys.In my script i have to pass the password as the argument to the scp command.is that possible??
rushi
it is not possible.
thomasmalt
But will work if i ll pass on a file containing the password??
rushi
What scripting language are you planning on using?
thomasmalt
with scp you can't pass the password, unfortunately...maybe there is a workaround using the [-o ssh_option] option of scphttp://manpages.ubuntu.com/manpages/lucid/en/man1/scp.1.html
udo
i am using the python script..
rushi
A: 

Can you check if this works -

<username>:<password>@<host>
Sachin Shanbhag
no it doesn't work:-(
rushi
A: 

What you want to achieve is not possible without using keys, or heavy duty scripting of the terminal.

Why don't you want to use keys? It's the easiest most secure solution to your problem.

Also take a look at: http://stackoverflow.com/questions/1340366/how-to-make-ssh-receive-the-password-from-stdin

Many scripting languages have modules that let you interact with ssh. If you're familiar with Perl you could take a look at the Net::SSH family of modules at CPAN: http://search.cpan.org/~rkitover/Net-SSH2-0.33/lib/Net/SSH2.pm

thomasmalt
ok....thanks:-)
rushi