Change root on 80 machines

 
Thread Tools Search this Thread
Operating Systems Linux Red Hat Change root on 80 machines
# 1  
Old 07-21-2010
Change root on 80 machines

I have inherited an 80 machine cluster and need to change root on all of them. Smilie Any ideas on an automated way to do that?

---------- Post updated at 11:29 AM ---------- Previous update was at 11:15 AM ----------

Assuming a stronger password, would this be a reasonable method for changing the passwords across all the machines. I have a list of all the machines and I was just going to iterate through the list and rsh to each.

Code:
#!/bin/sh
for i in `more machine.txt `
do
 echo $i
rsh $i echo "root:123" | chpasswd
done


Last edited by Scott; 07-21-2010 at 12:32 PM.. Reason: Code tags
# 2  
Old 07-21-2010
Hi.

If you have to type a password for each server with rsh, use ssh (you might need the -n option with it) instead. Otherwise, I think the method you have chosen is perfectly reasonable.

You need to quote the command, I think, otherwise chpasswd will be run locally.

Code:
rsh $i 'echo "root:123" | chpasswd'

This User Gave Thanks to Scott For This Post:
# 3  
Old 07-21-2010
Thanks Scottn! Smilie
# 4  
Old 07-21-2010
These 2 Users Gave Thanks to fpmurphy For This Post:
# 5  
Old 07-21-2010
Awesome Thanks!
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Can a root role change the root password in Solaris 10?

i do not have root on a solairs 10 server , however i do have the root role, i was wondering if I can change the root password as a a role with the passwd command? I have not tried yet. and do i have to use the # chgkey -p afterwards? i need to patch is why i am asking. thanks (1 Reply)
Discussion started by: goya
1 Replies

2. Ubuntu

Root access that can't change root password?

We are having a little problem on a server. We want that some users should be able to do e.g. sudo and become root, but with the restriction that the user can't change root password. That is, a guarantee that we still can login to that server and become root no matter of what the other users will... (2 Replies)
Discussion started by: 244an
2 Replies

3. Shell Programming and Scripting

Script to change the file at one go on different UNIX machines

Hi Folks , I have a query that is I have a server (unix machhine) to which I login thru winscp or putty , mostly I use putty and at a particular location there is one xml(abc.xml) while which I change , let say 1) I login to first unix box hostname :- ccc74 username ... (1 Reply)
Discussion started by: tuntun27272727
1 Replies

4. Shell Programming and Scripting

How to change passwords for User accounts on multiple UNIX/Linux machines remotely?

Hello Experts, Need some direction on creating shell script for following environment: We have about 20 people in the team working as Oracle DBA's (sysdba's and appdba's). Total Servers which is a mix of Unix and Linux are 200. We do not have Root user access on any of the servers and... (3 Replies)
Discussion started by: sha2402
3 Replies

5. Solaris

Solaris 8 - Asks for current root password when trying to change root password.

Hello All, I have several solaris boxes running Solaris 8. When changing root passwords on them, all will simply ask for the new root password to change and of course to re-type the new password. One of the systems however asks for the existing root password before it will display the new password... (8 Replies)
Discussion started by: tferrazz
8 Replies

6. Red Hat

Change root

i am having 4 operting system RHEL4 RHEL5 SLES9 SLES10 when the system boots up i need to have rhel4 so how to change the mount point and after that how can change the root to diff OS' somebody help me thanks revenna (2 Replies)
Discussion started by: revenna
2 Replies

7. HP-UX

Change root password?

Hello! I forget the root password and I need to change it. I've read others threads about it in this forum, but it seems it's necessary to modify /etc/passwd file. In my HPUX Systems this passwd file have only "read" permissions ant its owner is the root user, so how can i modify this file, if I... (4 Replies)
Discussion started by: kaugrs
4 Replies

8. HP-UX

How to change root password on HP UX

Hello, I try to make a change on the root password on HP UX. I use sam but it didn't work here. I try to login as root but I failed however, I login to my name and then change to su and su password then it is o.k There is not much different from root and su but how do we use root? Thanks so... (4 Replies)
Discussion started by: mle06
4 Replies

9. UNIX for Dummies Questions & Answers

How to change time as root?

Hi, Can someone tell me how to change time inside red hat linux machine as root? ThanX! (1 Reply)
Discussion started by: whatisthis
1 Replies
Login or Register to Ask a Question