Linked Questions

1
vote
2answers
22k views

ssh to multiple hosts and run a command [duplicate]

How do I ssh into multiple hosts (e.g host1, host2, host3, etc) and cat /etc/fstab to generate report.txt?
3
votes
3answers
58k views

Script for login in multiple servers and execute commands and append output in one file [duplicate]

I got the task of logging into some 300 devices, execute the following commands and then copy the output into one file. I can use SSH as a login method and I can give a predefined username and ...
4
votes
3answers
19k views

Running commands on multiple servers [duplicate]

I want to execute a process on multiple servers. I am using the following wrapper script. The script moves to servers one at a time. I would like to change it so it can execute on multiple servers. ...
1
vote
2answers
4k views

Execute command on multiple severs in parallel using shell script [duplicate]

I have 1000s of remote machines. I want to run some specific commands on all of them, but in parallel. I use these commands which run sequentially: for f in `cat host.lst` do ./runScript.sh $f ...
3
votes
1answer
5k views

Ssh to a box, run a command, output data to a file, then move on to the next IP adress [duplicate]

I want to run a script from my Jump server, have it SSH to a server, then run a command (like rm <file>, top or ls -lsa) then take that output and put it in to a file on my Jump server then move ...
1
vote
1answer
2k views

SSH into multiple servers executing multiple commands [duplicate]

I have several hosts that need to have a one-off RPM installed as well as packages belonging to the CentOS-Debuginfo.repo. These machines currently have the repo disabled and gpgcheck enabled. After ...
-1
votes
3answers
2k views

bash script to login to multiple Linux servers and collect the output of multiple commands through ssh [duplicate]

I need to login and collect output of below commands from multiple GNU/Linux servers through SSH. I have done password-less SSH authentication. I wanted to do this with bash script. df -lh | awk '{if ...
1
vote
1answer
2k views

How to SSH to a list of network devices and execute a list of commands? [duplicate]

Does anyone know how to create a bash script that would SSH to a list of network devices, via IP addresses, and execute a list of commands? The way I see this working is as follows: List of IP ...
0
votes
3answers
598 views

How to automate similar commands to multiple servers via SSH? [duplicate]

I have x servers that I can connect via SSH via passwords. If I have to connect with only 1, I will ssh root@IPaddress. It will then ask for my password, and when authenticated, I can execute commands ...
0
votes
1answer
865 views

Script to SSH to multiple Linux Server and execute a find command [duplicate]

I need a script that can SSH to multiple servers and execute a find command to check when was the last time a file was created.
0
votes
2answers
607 views

How to run a shell script on 10 hosts simultaneously? [duplicate]

Currently I am monitoring 10 hosts. I want to write a script which will calculate the disk space in every 24 hours and then if the file system of a host is critical for any host then it will move the ...
1
vote
0answers
541 views

Log in to multiple remote servers and execute a script [duplicate]

I want to make a script that will remote login to the multiple servers listed in a txt file like 10.3.9.6 10.3.9.7 and all servers have same username and password. and want to capture the output of ...
2
votes
2answers
222 views

Increasing Productivity When SSH into Multiple Hosts [duplicate]

I work in operations and need to be able to log into multiple servers among a few hundred servers in a productive way. What I mean by productive is this: from the time from when someone asks me to ...
0
votes
1answer
123 views

ssh multiple server for tar operation [duplicate]

I have a file containing IP address of 10 servers. e.g host.txt I want to tar a directory and on 10 differents server from 1 server. How can I run ssh parallel to those server which can reduce my ...
8
votes
6answers
3k views

How can I reproduce commands run on one machine on another machine?

I would like to install some software on a linux-machine that I have run in VirtualBox. Then I would like to do the same thing on a linux-VPS. I think that I can save all commands that I run using ...

15 30 50 per page