Script for changing the password

From: Koul, Minoti (koulmin@ugs.com)
Date: Wed Jun 22 2005 - 01:33:18 EDT


Hi Managers,
I am in a situation wherein I have to change root password of 100 odd
unix boxes. I wanted to do the same via a script.

I used to do it the crude way
#!/bin/ksh -x
cp -p /etc/shadow /etc/shadow.11
cat /etc/shadow|grep -v root>/tmp/shad1
echo "root:O75xmUttfitCw:12794::::::">>/tmp/shad2 ## here I am echoing
the encripted string for new password"
cat /tmp/shad1>>/tmp/shad2
cp /tmp/shad2 /etc/shadow
/usr/sbin/pwconv
chown root:sys /etc/shadow
chmod 400 /etc/shadow

I understand that we can input the new password via a script using !! .
But have'nt been able to do this successfully.
Can you please help out.

#####################################

MY NEW MOBILE NUMBER: 9860092579

#####################################

Regards,

Minoti Koul

UGS - Pune, India

Direct: +91-20-22930635

Board: +91-20-22930900

Cell: +91-9860092579

E-mail: minoti.koul@ugs.com
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:30:56 EDT