help with sed with solaris/linux password script



I have over 2000 machines where I need to change a password for a certain user. The password is thesame through all the boxes. I have a script, but I'm terrible with sed. If anyone can help, it would be much appreciated.

I'm trying to edit the entry below with the new password:

user:Hs4mx85gKHOBY:13594:7:56:7:::

When I run my script to update this password, I get this result:

user:dTeamw8RPFvFE:

The ideal result should be:

user:dTeamw8RPFvFE:13594:7:56:7:::

Additionally, I'll be using fanout to have multiple remote connections to edit the /etc/shadow file. I'm new to this tool as well. Hopefully it works.


Here is my script:

#!/bin/sh
#
# This script sets the system's user password to the entry defined in PASSWD.

echo "setting password for user"

# set the user password
PASSWD=dTeamw8RPFvFE
/usr/bin/cp /export/home/scripts/shadow /export/home/scripts/shadow.orig
/usr/bin/sed -e "s/user:.*./user:$PASSWD./" /export/home/scripts/shadow.orig > /
export/home/scripts/shadow
/usr/bin/chmod 400 /export/home/scripts/shadow



---------------------------------
Don't get soaked. Take a quick peek at the forecast
with theYahoo! Search weather shortcut.
_______________________________________________
sunmanagers mailing list
sunmanagers@xxxxxxxxxxxxxxx
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



Relevant Pages

  • Re: Editing Binary Files
    ... I want to edit a precompiled ... pipe that into ... 'awk' script which searches for the pattern you are ... it is then processed and 'uudecode' is used to get the text back ...
    (comp.unix.questions)
  • Re: Using echo in Bash
    ... the filenames into a text file, edit it with a text, then turn the file ... > Isn't it the 'echo' command that have to do be able to echo editable text? ... > Sure=) I have made this little Bash script that converts MusePack ... > The script is called repack, ...
    (alt.linux)
  • Re: Live byte count possible whilst *in* a field?
    ... Is it possible in FMP 6 and/or 9 to have a live byte counter? ... end loop ... I had to tinker with the script a bit and got it ... possible after the loop has been left) and needs to edit the message and to ...
    (comp.databases.filemaker)
  • Re: Replace lines in a text file?
    ... This example loads the entire script into memory at once so you probably ... >> writing to text files, but I cannot find a solution for line replacement. ... You can't edit files in situ. ...
    (microsoft.public.windows.server.scripting)
  • Re: Need help with a security issue on MS SQL 2000
    ... You script out the permissions, drop the user, edit the script, and recreate ... SID, delete the new user, then manually edit the syslogins table. ... HIGHLY recommend you not do this. ... > the SQL server, it doesn't seem to pick up on the name change. ...
    (microsoft.public.sqlserver.security)