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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passwd and NOT force user to change when log in 1

Status
Not open for further replies.

nomad1945

MIS
Oct 28, 2003
90
US
Ok I have this I think simple issue I can seem to figure out.
I need to offer a couple of users the rights to add users and put a password in for
the user and NOT have the user change it, since it is only for a portal, and the user will never actually log on directly to the system.

I have set sudo for them to add the user, however if they change the passwd either by sudo, or if I change it as root, and I test it, by telnet it keeps prompting me to change it.

How do I get the passwd to passoword a user account and not force them to change. I just don’t know if they log in through the portal, if it will work since it would somehow think the user password is expired.

thanks

 
When you change another user's password, the flag ADMCHG is added to this user in the /etc/security/passwd file.

If you delete this flag then it won't force to change the password.

If you can't or don't want to grant permissions on /etc/security/passwd, you can login with the user's new password and change it, after that it won't ask for a new password.

This is an example for the /etc/security/passwd:
Code:
username:
        password = 09f/Pjl4cpDyY
        lastupdate = 1190893712
        flags = ADMCHG

You have to delete the ADMCHG flag, so it looks like this:
Code:
username:
        password = 09f/Pjl4cpDyY
        lastupdate = 1190893712
        flags =
 
You have to run

pwdadm -c username

in order to trick the system into thinking the password is not changed by administrator (all password flags for that user are cleared).

See man page for more info. Use (especially if sudo'd) with care.


HTH,

p5wizard
 
Nice one, I had a look at pwdadm man page, but didn't understand well what "-c Clears all password flags for the user." meant.
 
Thank YOU! Both...

P5Wizard I think I can work with your suggestion, since I dont want to give these people to much, and its makes it simple, even though it may be an extra step.

thank you again to both
 
Be careful with the -c option, since it will also erase the others flags (ADMIN, NOCHECK).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top