• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

UNIX ADMIN RUN COMMANDS of Other Users on the box

i need ideas for how to run a script that will span to run commands on different servers under different users
0
EmadGirgis
Asked:
EmadGirgis
1 Solution
 
Abhishek_ChibCommented:
Simply, copy script to new server user, and change the permission of script with

chmod 550 script_name.sh

and run your scripts.

Note : you need to take care script environment setting like Perl etc.

 
0
 
TintinCommented:
Assuming you have ssh keys set up, you could create a file with the users and servers, eg:


user1  server1
user2  server2

Open in new window



Then in your script, you do:

#!/bin/sh
while read user server
do
   ssh $user@$server "some comand or script"
done <server.list

Open in new window

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now