LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-18-2005, 10:05 AM   #1
mesh2005
Member
 
Registered: Sep 2005
Location: Ägypten
Distribution: Ubuntu 5.10
Posts: 155

Rep: Reputation: 30
Run a program on multiple pcs


i use RedHat 7.2, i have many pcs in my LAN (linux m/c). i wrote a program and i want to ask is there any command that can help me to run this program on all these machines at ones from my server? is it possible?
thanks
 
Old 09-18-2005, 10:16 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Welcome to LQ.

The easiest way would probably be to set up public key authentication using SSH:
http://www.linuxquestions.org/questi...ticle&artid=79
 
Old 09-18-2005, 10:21 AM   #3
mesh2005
Member
 
Registered: Sep 2005
Location: Ägypten
Distribution: Ubuntu 5.10
Posts: 155

Original Poster
Rep: Reputation: 30
is there any other way to be done programmatically? i want to write a shell script (tcsh or bash) r to use Perl that execute my program on each m/c (i have a list of the names...)
thanks
 
Old 09-18-2005, 10:27 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Sure, once you have set up the authentication you just need to loop through each host in a list and run the command - ie:
hosts="hosta hostb hostc"
for host in $hosts;do
ssh user@$host command
done
 
Old 09-18-2005, 02:33 PM   #5
mesh2005
Member
 
Registered: Sep 2005
Location: Ägypten
Distribution: Ubuntu 5.10
Posts: 155

Original Poster
Rep: Reputation: 30
mmm this is nice, but someone told me that there is a command i think P2 or something like that : P2 command host-list . is it a valid command?
thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting a single ethernet port to multiple PCs? beejayzed Linux - Networking 14 09-08-2005 04:14 PM
Old PC as a Router/Fire for Multiple PCs AxXium Slackware 21 08-17-2005 10:02 AM
Viewing program messages when program isn't run from command line? Locura Linux - Software 1 09-27-2003 08:19 AM
multiple instaces of same program ORiON2012 Linux - General 3 01-22-2003 06:02 PM
how to run multiple X windows? Chooco Linux - General 8 06-11-2002 05:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration