help with sed with solaris/linux password script
2007-12-25 6:58:00
I know this is not the place to ask Linux questions, but the script broke the shadow file on our Linux servers. It worked great on our Solaris machines, but I need to figure out why the shadow file got zeroed and the backup was not created in /tmp.
Here is the revised script:
#!/bin/sh
echo "setting password for user"
# set the user password
PASSWD=passwordhere
/usr/bin/cp /export/home/scripts/passwords/shadow /export/home/scripts/passwords/shadow.orig
/usr/bin/sed -e "s/user:[^:]*\(.*\)/user:$PASSWD\1/" /export/home/scripts/passwords/shadow.orig > /export/home/scripts/passwords/shadow
/usr/bin/chmod 400 /export/home/scripts/passwords/shadow
Please help :)
---------------------------------
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
Comments
Got something to say?
You must be logged in to post a comment.

