Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
scp as batch job
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
numerodix
l33t
l33t


Joined: 18 Jul 2002
Posts: 743
Location: nl.eu

PostPosted: Tue Dec 03, 2002 7:59 pm    Post subject: scp as batch job Reply with quote

I've been trying to set up a cron job that will download a certain file at a given interval. And I've been using ftp so far but I would like to upgrade the security and move on to scp/sftp. But somehow I've failed to understand how it can be done in non-interactive mode. With wget I used this line:

Code:
wget -nv -o wget.log ftp://username:password@www.site.com/path/to/file


Can you tell me how to set up the equivalent with scp or sftp?
Back to top
View user's profile Send private message
rac
Bodhisattva
Bodhisattva


Joined: 30 May 2002
Posts: 6553
Location: Japanifornia

PostPosted: Tue Dec 03, 2002 8:36 pm    Post subject: Reply with quote

First off, you might be interested in a series drobbins wrote for IBM's developerWorks: Here's part 1. Once you have ssh configured to use public key authentication, you won't need to type passwords. You can use the keychain utility to deal with ssh-agent too, if you wish. At that point, I think you can:
Code:
$ scp www.site.com:/path/to/file wget.log

_________________
For every higher wall, there is a taller ladder
Back to top
View user's profile Send private message
pilla
Bodhisattva
Bodhisattva


Joined: 07 Aug 2002
Posts: 7729
Location: Underworld

PostPosted: Tue Dec 03, 2002 10:15 pm    Post subject: Reply with quote

Not that complete, but you can start with
Code:

man ssh-keygen


If your passphrase is empty, it won't require a password to run the script.

Cheers
Back to top
View user's profile Send private message
kashani
Advocate
Advocate


Joined: 02 Sep 2002
Posts: 2032
Location: San Francisco

PostPosted: Wed Dec 04, 2002 12:49 am    Post subject: scp batching Reply with quote

look into ssh trusts, I'd expound, but this guy has done it so much better.

http://boran.dyndns.org/security/sp/ssh-part2.html#Trusts

kashani
_________________
Will personally fix your server in exchange for motorcycle related shop tools in good shape.
Back to top
View user's profile Send private message
Kream
n00b
n00b


Joined: 19 Apr 2002
Posts: 30
Location: New Delhi, India

PostPosted: Fri Dec 06, 2002 4:52 am    Post subject: Reply with quote

emerge dev-tcltk/expect

use autoexpect to create the script.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum