Re: sync root passwords?
hi ya mike
On Mon, 16 Dec 2002, Mike Egglestone wrote:
> Quoting Rich Puhek <email@example.com>:
> > Hopefully, you're using ssh on all your machines. If so (and if you're
> > set up to use public keys for authentication, instead of passwords) you
> > could do something like:
> > #/bin/sh
> > servers="server1 server2 server3 server4";
> > for server in $servers; do
> > ssh $server passwd root $1;
> > done;
> > which would ssh into every server in the list $servers, and change the
> > root password to the given arguement.
> I'm not sure if I understand the passwd command properly.
> What is the purpose of the $1 in the above script?
assume that script is called /root/pwd.sh
root# /root/pwd.sh "newpasswd is here"
and it should be updating it to server1, server2, server3..
- break into machine xx and you have access to server1...4
and ... you now have the passwd in clear text in ~/.bash_history
- dont forget to erase it
-- i prefer ... pull... vs pushing files around...
on each client... i pull down any new changes via cron
if ( master:/etc/shadow changed )
scp Master:/etc/passwd.client /etc/shadow
- or -
scp /net/Master/etc/passwd.client /etc/shadow
you're job is to make sure the files to be pulled/pushed
is 100% correct
and to check if all passwds are in sync
grep userA /n/all_PCs/etc/shadow | cut -d : -f 3
# the resulting data should all be identical pwd for users
> I have run this script but every server I login to, the passwd command
> gets run, and I'm prompted to issue the new password, and then re-type it.
> I pretty sure I'm lost on what supposed to be happening.
> I would appreciate some guidence. :)
> This mail sent through IMP: http://horde.org/imp/
> To UNSUBSCRIBE, email to firstname.lastname@example.org
> with a subject of "unsubscribe". Trouble? Contact email@example.com