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

Notices

Reply
 
Search this Thread
Old 01-03-2005, 12:44 PM   #1
dlublink
Member
 
Registered: Oct 2004
Location: Canada
Distribution: Ubuntu
Posts: 329

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 ?

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

Rep: Reputation: 64
I would suggest setting up public key authentication:
http://www.linuxquestions.org/questi...ticle&artid=79

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.
 
  


Reply


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 03:47 PM
Does not prompt for password ssharma_02 Linux - Security 6 06-02-2005 01:51 AM
ssh/scp without password not working Mauline Linux - Security 4 03-30-2005 09:26 PM
scp still ask for root 's password when executing... Laplace Linux - General 1 03-02-2003 07:45 AM
scp and no password mikeyt_333 Linux - General 2 03-26-2002 03:33 PM


All times are GMT -5. The time now is 09:34 PM.

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