Re: how to logon to 30+ machines and put a job run in background and then logout automatically in a script file?

From: Bill Marcum (bmarcum_at_iglou.com)
Date: 09/27/03


Date: Sat, 27 Sep 2003 16:46:16 -0400

On Fri, 26 Sep 2003 17:50:33 -0500, walala
  <mizhael@yahoo.com> wrote:
> Dear all,
>
> I am facing a problem that needs your help... I need to run a simulation in
> part on about 30+ unix workstations, servers, etc. We use ssh here.
>
> Every time I need to do the following:
>
> ssh username@machinename1.xxx.xxx.xxx
> nohub run_some_job_in_background &
> logout
> ssh username@machinename2.xxx.xxx.xxx
> nohub run_some_job_in_background &
> logout
> ssh username@machinename3.xxx.xxx.xxx
> nohub run_some_job_in_background &
> logout
>
> the trouble was:
>
> a. The above script scheme did not work. after I typed in the password for
> the first login, it logged onto the first machine, and run .cshrc of that
> machine, and then stopped, without running my "nohub" and "logout" command,
> basically, it stopped there;
>
I think you mean "nohup", and couldn't you do it on one line, like
ssh username@machinename "nohup run_some_job &"

> b. Even if the scheme worked, there still has the trouble that everytime I
> need to type in password again and again for the 30+ machines...
>
By using public keys, you don't need to type the password.
man ssh
man ssh-copy-id

> Can anybody give me help on how to fully streamline the whole process?
>
> Thanks a lot,
>
> -walala
>
>

-- 
Commander Spiral Pyjama Pseudo-Rhinocerous Feline Thingamajig Bill Marcum 
(the First)
Ozy and Millie Name Generator http://heifong.phase.org/omname.php


Relevant Pages