Home · Latest · Trends  /  general
0

Use SSH in batch mode if hitting multiple servers

rated 0 times [  0] [ 0]  / comments: 1 / hits: 345  / 2 yaers ago, thu, mar 1, 2018, 15:08:49
Using batch mode and adding a timeout will help get through a long list of servers that may or may not be up.
# SSH as user root to multiple rowty.net servers..

# The list of servers
host1.rowty.net
host2.rowty.net
host3.rowty.net

# Run a command on all of them - using batchmode and timeout
for m in $(cat ./rowty-servers.txt);do ssh -o BatchMode=yes -o ConnectTimeout=1 root@rowty.net "uptime";done
More From » general
 

Comments

0
Spot on with this particular write-up, I truly think this website needs extra consideration. I’ll probably be again to read extra, thanks for that details. game ml
[#79] Wednesday, June 19, 2019, 10:14:24
 
luciham20
commented 4 months ago
Only authorized users can post. Please sign in first, or register a free account
 
Share
Sponsor
Posted
rob

rob

Member since Feb 22, 2017
Total Code Snippets: 128
Total Comments: 1
Location: n/a
Following
User not following anyone yet.
rob snippets
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017
3 yaers ago, wed, feb 22, 2017