Re: How to change password on multiple hosts (can use ssh)



On Tue, 10 Feb 2009 01:23:06 +0000, Tech Geek way over crossposted.

Thanks for the response and information. Not sure why we didn't
implement NIS...I will check this out. As regards copying the password
file and shadow files...doesn't it require root access.

If you want to change the password file, then you are going to need
root access. If you can use ssh, then you can use scp. If host1 has the
new password file, and you want to send it to host2.

scp host1:/etc/shadow host2:/etc/shadow

I haven't done
this (I am not a Sys Admin!)

If you are given the task of maintaining the passwords of 125 machines,
then you are now a "Sys Admin".

.,...will this approach allow copying over
the shadow file entries only for one user?

You can change one line. For example if I grep for the username "guest"
I will see the line with the quest password.

grep guest /etc/shadow
guest:$1$Le8tyxs2$CEV9tQNxxYr5aLJVXkvHX1:14011:0:99999:7:::

The password string is right after the username and a ":" character
A short sed command can change the string into a newstring.

sed -i 's/guest:[^:]*:/guest:newstring:/' shadow

Will it be possible to help
me some more additional information on this approach. Appreciate your
time and help with this.




.