Shell script to login into multiple linux boxes

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script to login into multiple linux boxes
# 1  
Old 07-20-2011
Hammer & Screwdriver Shell script to login into multiple linux boxes

I have requirement to login into a multiple linux boxes by running the shell script in a single linux box and to find the count of files in a specific folder in each box and log them in a log file in the box where i m runnning the script. Box names will be stored in a text file host.txt.

Please do let me know if anyone has an idea on that.
# 2  
Old 07-20-2011
set passwordless ssh ( google it )

while read systemName
          ssh user@systemName "ls -l /your/path | wc -l > count.txt" 
done < host.txt

wc -l gives +1 in your result as it count the line number which is "total"
# 3  
Old 07-21-2011
passwordless ssh

My main concern is i have to login into 300 linux server and all are having same userid and password. I dont want to create any key for each server to login . Is there a way to run the script ?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script as login shell (passing args to login shell)

Hello all, for security reasons my compagny imposes that my script be launch remotly via ssh under the users login shell. So serverA launches the ssh command to serverB which has a local user with my script as a login shell. Local script works like a charm on his own. serverB$ grep... (20 Replies)
Discussion started by: maverick72
20 Replies

2. Linux

Linux script for multiple box login.

Hello! We currently use a SecureCRT .vbs script which automates logging into multiple boxes to run a few commands. However, I'd like to have something run in Linux vs. our emulator. Below is my objective :): Our current .vbs script will look at an IP list .txt file on our PC, then login to... (1 Reply)
Discussion started by: birdboyee
1 Replies

3. Shell Programming and Scripting

Need a script to scp a file to multiple boxes

Hello All, I am new to scripting and I am trying to write a script which can scp a file from one box to multiple boxes. I am thinking to do like this. 1) create a file with list of all server names 2)write a script which will pick up each server line by line from server list and copy it to... (1 Reply)
Discussion started by: sintilash
1 Replies

4. Shell Programming and Scripting

How to run multiple instances of shell script in linux?

How we can run the multiple instances of the script? I need to run the script which I am calling from the below function.I can doit with cron but I don't want to put it in the cron.This cript dploy the build and here I want when the build stage then it should run with multilpe instances of... (6 Replies)
Discussion started by: anuragpgtgerman
6 Replies

5. Shell Programming and Scripting

shell script to collect information from current and remote unix boxes

I am using AIX ; I need a script to find out each remote AIX boxes Hostname, Model name and Serial number in following format Hostname Modelname SerialID AIXMC01 IBM,7026-B80 IBM,0110BBA1F AIXMC02 IBM,7026-H50 IBM,0110BBA56 AIXMC03 IBM,7026-H50 IBM,0110BBARR... (12 Replies)
Discussion started by: amir07
12 Replies

6. Shell Programming and Scripting

Shell script to change the password on multiple servers in linux

Can any one please let me know the shell script to change the password for a particular user on multiple linux servers. (2 Replies)
Discussion started by: s_madras
2 Replies

7. Shell Programming and Scripting

Automated ssh to multiple boxes

I have a script that will ssh to several different servers, perform a command, display the output, and exit. It works well, but I have to enter my password for each server. That gets a little cumbersome when you have a couple dozen servers. Anyone out there know how to automate this so that I only... (2 Replies)
Discussion started by: fedexer
2 Replies

8. Shell Programming and Scripting

I need a Script to rsh multiple hp boxes and shutdown

Hello I'm serving on a ship that has frequent power issues. Currently if we loose power we need to rush around to multiple UNIX machines and login to Sysadmin and power down each machine before we loose our ups. If sysadmin is asleep or not in the space we have some real problems. I would like to... (2 Replies)
Discussion started by: blackfam972
2 Replies

9. UNIX for Dummies Questions & Answers

Getting one script to run on multiple boxes

I have a script that generates an output file after pulling data from a local DB on one of my boxes. There are other nearly-identical boxes on the network, each with their own local DB, and I'd like to run the script there too. Copying the script to each box and then running them individually... (11 Replies)
Discussion started by: bschnair
11 Replies
Login or Register to Ask a Question