[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: rsyncing via cron



on Sat, 08 Feb 2003 01:01:48PM -0500, sean finney insinuated:
> On Sat, Feb 08, 2003 at 12:31:00PM -0500, Nori Heikkinen wrote:
> > how can i create a cron job to rsync to a remote system?  i use
> > ssh-askpass, but since cron runs as root, i get
> 
> ssh-askpass is just a frontend to ssh-add, which is just a means for
> loading keys into your ssh-agent.  assuming you're not running cron
> as a child of an ssh-agent process (which granted, would be sweet),
> i don't think it'd help much.  if you're trying to use public key
> authentication, what you need is a passphraseless key (which i'm
> guessing you may already have) just for the job, called say
> .ssh/id_dsa_cron and .ssh/id_dsa_cron.pub.  after you put the public
> key in your authorized keys file, you're basically set.  all you
> need to do is
> 
> export RSYNC_RSH="ssh -i .ssh/id_dsa_cron" rsync ....
> 
> or
> 
> rsync -e "ssh -i .ssh/id_dsa_cron" ....
> 
> and then the ssh session spawned by rsync should attempt to
> authenticate with your key.

so as i mentioned, this is beautiful.  what about scp'ing as a cron
job?  the analogue looks like it would be just

scp -i $HOME/.ssh/id_dsa_cron <filetoscp> <wheretoscp>:

but i get that "permission denied" error.  what's up?

thanks again,

</nori>

-- 
    .~.      nori @ sccs.swarthmore.edu 
    /V\  http://www.sccs.swarthmore.edu/~nori/jnl/
   // \\          @ maenad.net
  /(   )\       www.maenad.net
   ^`~'^
  pgp servers broken: get my (*new*) key here:
    http://www.maenad.net/geek/7ede5499.asc

Attachment: pgp5D8gG2cbHl.pgp
Description: PGP signature


Reply to: