LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-01-2013, 05:50 PM   #1
nomee786
LQ Newbie
 
Registered: Mar 2013
Posts: 13

Rep: Reputation: Disabled
Multiple server login


Can someone tell me by using for loop in Linux how can I login to multiple server?
 
Old 08-03-2013, 03:22 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Not much to go on, but have a look at these 2 examples:
Code:
for THISSERVER in hostname1 hostname2 hostname3
do
  echo $THISSERVER
done
If the server names are in a file (1 server per line):
Code:
while read THISSERVER
do
  echo $THISSERVER
done < host_names
Using a while loop in this case is the better way to go. If, for whatever reason, you do need a for loop:
Code:
for THISSERVER in $(cat host_names)
do
  echo $THISSERVER
done
I used echo as an example, the actual code you want to use goes between do and done
 
1 members found this post helpful.
Old 08-03-2013, 07:12 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
Wheel reinvention-wise there's OTS tools dealing with ^whatever.on.*multiple hosts already like ClusterSSH, Dsh, Fanout / Fanterm, Tentakel, Shocto, SwitchTower, MUC, Parallel SSH and RGANG. If this is solely about getting system stats (without even requiring SSH or password-less logins) you could also resort to using a simple (X)inetd-based script or better: use SNMP.
 
Old 08-07-2013, 02:27 PM   #4
nomee786
LQ Newbie
 
Registered: Mar 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
This is general question?

How to Install server patches on Linux servers?
 
Old 08-07-2013, 02:45 PM   #5
dt64
Member
 
Registered: Sep 2012
Distribution: RHEL5/6, CentOS5/6
Posts: 216

Rep: Reputation: 38
Quote:
Originally Posted by nomee786 View Post
How to Install server patches on Linux servers?
Well, this might should have gone to its own thread, but how about trying
Code:
yum update
or
Code:
aptitude update
or
Code:
aptitude dist-upgrade
depending on your distro.
Depending on what you actually use there may be different ways of upgrading your system and install available patches but without any more details about your installation my possibilities to help are limited.
 
  


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
Central login server for multiple linux boxes kitek Linux - Newbie 3 05-07-2012 07:19 PM
SSH without password for multiple server login mspatil0037 Linux - Newbie 8 08-01-2011 01:48 AM
Multiple machines, one login server. Is it possible? phenderson Linux - Networking 2 05-21-2004 08:12 AM
login server for multiple Linux boxes? freddieB Linux - Networking 1 11-26-2001 11:20 AM


All times are GMT -5. The time now is 06:08 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration