Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 01-03-2005, 01:44 PM   #1
Registered: Oct 2004
Location: Canada
Distribution: Ubuntu
Posts: 330

Rep: Reputation: 30
scp, don't prompt password!!

scp somefile.ext username@remotehost.tld:/path/to/where/I/want/it

This obviously asks for my password. I do not want it to ask for my password, I want to put the password on the command line. So I tried:

echo "secret" | scp somefile.ext username@remotehost.tld:/path/to/where/I/want/it

That does not work.

How do I pass the command my password so I can put it in a script ?

Old 01-03-2005, 01:54 PM   #2
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 67
I would suggest setting up public key authentication:

If you use lines like that in a script they will often be visible to any other user that lists the proccesses which are running. If you need to have the password in a script then use an expect script.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Include scp password in command cli_man Linux - General 1 08-05-2005 04:47 PM
Does not prompt for password ssharma_02 Linux - Security 6 06-02-2005 02:51 AM
ssh/scp without password not working Mauline Linux - Security 4 03-30-2005 10:26 PM
scp still ask for root 's password when executing... Laplace Linux - General 1 03-02-2003 08:45 AM
scp and no password mikeyt_333 Linux - General 2 03-26-2002 04:33 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 05:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration