Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passwd -f (SCO) vs passwd -f (REDHAT) 1

Status
Not open for further replies.

KarveR

MIS
Dec 14, 1999
2,065
GB
Hi all, a little Friday teaser (OK so it s Wednesdaybut I have the rest of the week off :))

Under SCO passwd -f [someuser] will force the user to change their password when they next log on.

Under Redhat passwd -f means to force the password operation (do it now!).

How do I make RedHat users change their passwords when they next log in, like I can do with SCO users.

Thanks in advance ,

//Karvmonkee ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
I don't see how you can based off the man pages and what not, what you could do though is set up a script to do this for you.

# PASSWORD CHANGE SCRIPT

#!/usr/bin/ksh -p

USER="$1"
CHKUSER=`/usr/bin/cat /etc/passwd|/usr/bin/grep "${USER}"`

if [ "${USER}" == "${CHKUSER}" ]
then
/usr/bin/passwd
echo "0" > /home/${USER}/flag
else
print "Invalid user name."
fi
#EOS


Setup the file flag in all of the user directories owned by root:sys or root:root with 644 permissions. Then in each users .profile setup this if statement:

if [ `/usr/bin/cat ~/flag` -eq 1 ]
then
/UPDPSWD.ksh USER_NAME_HERE # for instance
fi


Set UPDPSWD.ksh or whatever you will call this script up as 755 permissions owned by root:root or root:sys.


Now the user could obviously change the name in his/her .profile, but unless they knew that the user they modified this to had a flag = 1, then it wouldn't do them any good. More could be done obviously to ensure checks which I would add myself as well. If you trust your users enough, this should work for you otherwise I don't think it can be done with the Redhat passwd command.
 
franklin97355, sorry it took so long to get back to you.

Top tip and star'd for good measure even though I thought you had a typo in there, until I tryed it :) exactly what I need, many thanks.

//Karv ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top