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

Re: rsyncing via cron



On Wed, Feb 12, 2003 at 05:56:35PM -0500, Nori Heikkinen wrote:
> 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?

Who's the cronjob running as?  ~/.ssh should be 700, which means no one
but you can read anything in there.

-- 
Rob Weir <rweir@ertius.org>				http://ertius.org/

Attachment: pgp88s5aLy74E.pgp
Description: PGP signature


Reply to: