Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

scp and avoiding the password prompt

Status
Not open for further replies.

ddrillich

Technical User
Jun 11, 2003
546
US
Good Day,

I would like to copy over a file to another server using the same user name/password I'm logged in currently. In case I use the following in a script, can I avoid the password prompt?

scp prx.db.03_15_11 sbkj2ksrchtxtf06:

Regards,
Dan
 
Hope I am not deviating much from the thread promp
Recently I had to setup a cronjob where periodically would copy the file over scp.The command portion of my cronttab looked something like that.
Code:
/usr/bin/scp -i /home/user/.ssh/id_dsa /tmp/file.dat server.net:~/
If I were to execute the same command above in terminal it would run successfully. However I never succeeded to do that via cronjob.
The server log file kept saying bad password. Like scp never used the key.
Any idea what could be the problem here? Both systems are gnu- linux
2.6.3x kernel.
 
First, you should open your own thread. Your question is different. Related, but different. Being in it's own thread makes it easy for others to find it.

Second, can you provide output and actual error messages? Also, add a "[tt]-v[/tt]" after the "[tt]/usr/bin/scp[/tt]" and it will print out debug messages.

Have you tried it without the "[tt]-i[/tt]" option and the path to the identity file? You should be able to default that.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top