[K12OSN] remote home directories/CRON?SSH

Sudev Barar sbarar at gmail.com
Fri Sep 9 02:51:05 UTC 2005


On 9/9/05, Sudev Barar <sbarar at gmail.com> wrote:
> On 9/8/05, Brandon Kovach <bkovach at logrog.net> wrote:
> > Sorry.  I should have been more clear.  I understand cron fairly well.
> > Certainly well enough to monkey with it.  However, how to make SSH run
> > well inside of cron ... Not sure.  I think the cron jobs I would setup,
> > would fail as the ssh session would be waiting for a password that I would
> > never be entering.  I know the key solves that problem.  I just don't know
> > how to do it yet.  I will by the end of the day, methinks.
> 
> From the machine initiating connection (one that is running cron) as root:
> $ssh-keygen -t dsa
> (see man for details but fairly simple, I choose dsa)
> 
> $scp  .ssh/id_dsa.pub TARGET:/root/.ssh/.
> 
> Next time you ssh in to TARGET this should not ask you for password.
> Now you can put everyting into cron.
> If needed you should have logged into TARGET and made directory .ssh
> before hand in /root  Same can be done for "user" if only user CRON is
> to be run effecting user directories.

SORRY, made a goof up.
First log into TARGET machine. Generate key pair there and scp this to
INITIATOR machine (from where cron is to run). ALWAYS generate key
pair in target machine and put the public part of the key on the
initiator.

-- 
Sudev Barar
Learning Linux




More information about the K12OSN mailing list