LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-13-2014, 07:05 PM   #1
fantasy1215
Member
 
Registered: Oct 2011
Posts: 75

Rep: Reputation: Disabled
How to ssh three remote linux box at the same time?


I have 4 linux machines, lets name it A, B, C, D. And the D machine can ssh to A, B, C using username TOM without password.
In machine A, B, C, They each contains a file ~/monitordata.
The thing I have to do is: in machine D monitor the three ~/monitordata files at the same time in the same screen.
And I don't have root previlege of none of the four machines.
Is it possible to do such job? Hope I express myself clear. And thanks in advance!
 
Old 01-13-2014, 07:14 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

clusterssh or mussh may be what you're looking for.

Evo2.
 
Old 01-13-2014, 07:25 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,263
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
You might consider screen or tmux, split the window into three panes and ssh to A, B and C from them. The advantage is there is probably nothing to install as screen should be on just about any GNU/Linux box.

Last edited by astrogeek; 01-13-2014 at 08:19 PM.
 
Old 01-16-2014, 03:22 PM   #4
new2bash
LQ Newbie
 
Registered: Jan 2014
Posts: 15

Rep: Reputation: 0
Quote:
Originally Posted by fantasy1215 View Post
I have 4 linux machines, lets name it A, B, C, D. And the D machine can ssh to A, B, C using username TOM without password.
In machine A, B, C, They each contains a file ~/monitordata.
The thing I have to do is: in machine D monitor the three ~/monitordata files at the same time in the same screen.
And I don't have root previlege of none of the four machines.
Is it possible to do such job? Hope I express myself clear. And thanks in advance!
As others have mentioned, screen is an excellent tool for this.

To automate the process, I'd set up a .screenrc file with the following (change my generic user@host to your user/host info) and you call it with
> screen -c .screenrc

Code:
# Screen config file

# Turn off startup banner
startup_message off


# Status bar
hardstatus alwayslastline "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H [system: %l]  %{..Y} %m/%d %C%a "



#  Virtual terminal & Split screen setup.

# Start virtual term one        (In top region)
 screen -t "Host1" ssh user@host1


# Split the session horizontally
 split

# Move focus down to center region
 focus down

# Start second virtual term     (In center region)
 screen -t "Host2" ssh user@host2

# Split the session horizontally -again-
 split

# Move focus to bottom region
 focus down

# Start third virtual term      (In bottom region)
screen -t "Host3" ssh user@host3
 
  


Reply



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
SSH time out on login attempt from remote box: command needed to check port 22 bweaver Linux - Security 3 12-01-2010 03:57 PM
user password not accepted when using SSH to a remote linux box emeak Linux - Newbie 2 08-06-2009 07:10 AM
Fedora 10/unable to ssh out from box to remote host (SSH within LAN ok) huskeypm Linux - Networking 3 04-14-2009 07:37 PM
Can I set ssh to change my konsole colours when I connect to a remote box? davee Linux - General 2 12-16-2004 02:56 PM
redhat 9, can't connect to ssh from remote box nathan plemons Linux - Networking 2 01-09-2004 06:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:58 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