Passwd -l or -u modifies lastchg field in /etc/shadow file


 
Thread Tools Search this Thread
Operating Systems Solaris Passwd -l or -u modifies lastchg field in /etc/shadow file
# 1  
Old 03-25-2015
Passwd -l or -u modifies lastchg field in /etc/shadow file

Hi,

I have a Solaris 10 box where password aging is not functioning properly. Using the passwd command with the -l or -u options causes the lastchg field in the /etc/shadow file to be modified. Therefore, if a user's password is set to expire in 90 days and they are 1 day away, all they have to do is lock their password and get it unlocked and they will have another 90 days using their current password.

I believe this could be a patch issue (missing one?) but I have been unable to track down a specific patch.

Any ideas/suggestions would be great.

Thanks
# 2  
Old 03-25-2015
How do they get it unlocked? I would suggest that whomever is doing the unlock needs to do three things in order:-
  1. Unlock the account
  2. Set a new password
  3. Expire the password
It may just be a procedural change. You can easily script these to give the people doing it just one command to run and mask off the other parts.



Does that help?


Robin
# 3  
Old 03-25-2015
Thanks for the suggestion. The only problem is once the account becomes locked (i.e. 3 failed attempts, etc), the lastchg field is modified in the /etc/shadow file and I don't know when the password was last changed by the user. So if the user changed their password 5 days ago and then locks their account but they know the password, I don't want the user to have to change their password again. I would only want to unlock their account and the user should still have 85 days before their password expires next. However, using passwd -u to unlock their account modifies the lastchg field and then they have another 90 days.

I don't think using passwd -l or passwd -u should modify the lastchg field. This box was upgraded over the years from previous Solaris versions and I'm guessing a patch related to this may exist but I haven't been able to find it.
# 4  
Old 03-25-2015
It's probably easiest just tell them that the policy has to be that way. If they request a new password or an unlock of an account then they are forced to pick a new one and you have control of the rules about complexity, history etc.

An alternate would be to intercept the passwd command and log every action on it. That might give you a history of when people last changed password.


Do either of these help?



Robin
This User Gave Thanks to rbatte1 For This Post:
# 5  
Old 03-25-2015
You could also make daily backups of the shadow file (not recycling them until you have accumulated one file for each day of your password expiration period). Then you can look at the shadow entries for the user you're unlocking to determine their password change history. (I presume that you also get notification when accounts are locked and unlocked that you can use to determine, by elimination, when the password was last changed by the user.) But, of course, if someone changed their password, forgot it, and was locked out trying to get back in all in one day, this won't catch that...
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Passwd,shadow files deleted and abort sequence disabled

Hi all.. I moved the /etc/shadow and /etc/shadow files to /tmp and then rebooted my PARC machine running 5.10. I did it to see if I could recover from single user mode. But, I forgot to enable the abort key-sequence which I earlier disabled. Stuck! One of my gurus told I had to... (9 Replies)
Discussion started by: satish51392111
9 Replies

2. UNIX for Advanced & Expert Users

psswd&shadow 2 passwd together?!!

hi, all I just started on new box where I have to diff passwd working perfectly on the very same account/user. I see that shadow was added recently (I'm not a root in there), I see 'x' in passwd. Not sure how it should work, should I change old passwd for one defined in shadow? Or it's fine to... (20 Replies)
Discussion started by: trento17
20 Replies

3. Solaris

9th field in shadow file

Hi experts, Can somebody explain, what is 9th field in /etc/shadow ? The last digit - (5 Replies)
Discussion started by: solaris_1977
5 Replies

4. Solaris

difference between /etc/shadow and /etc/default/passwd

Hi , can anyone explain me the difference between /etc/shadow and /etc/default/passwd . As per my knowledge both the files are used for password aging and control parameters. (2 Replies)
Discussion started by: rogerben
2 Replies

5. Solaris

passwd cmd reenables passwd aging in shadow entry

Hi Folks, I have Solaris 10, latest release. We have passwd aging set in /etc/defalut/passwd. I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging. When I reset the users passwd using passwd command, it re enables... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

6. UNIX for Advanced & Expert Users

Converting freebsd (5.2.1) master.passwd to Debian shadow

I'm trying to make this work, and it half works. Accounts with password hashes matching the old crypt(3) algorithm work just fine: JUpfW/w6jo6aw But accounts with longer password hashes preceded by $1$, such as the following, do not work: $1$iIcbppdP$HDyjJeVMGgJ.ovLsnjtTR.... (0 Replies)
Discussion started by: davidstvz
0 Replies

7. Solaris

tool to convert /etc/passwd and etc/shadow

i wonder if there is a tool to read the /etc/passwd or /etc/shadow files in order to reset user accounts to the same one. By moving (restore) all filessytem and data to another same Sun box, none of the users are able to logon to the new box which i didn't change nothing. But if i reset the user... (1 Reply)
Discussion started by: lamoul
1 Replies

8. UNIX for Dummies Questions & Answers

How to : Identify the the password is encrypted or not in /etc/shadow or /etc/passwd?

Thanks AVKlinux (11 Replies)
Discussion started by: avklinux
11 Replies

9. UNIX for Dummies Questions & Answers

Impact of shadow file 'lastchg' parameter NULL or 0?

I've encountered shadow files where the "lastchg" parameters are set to NULL and also zero (0) for some Solaris machines (one running v10, one running v8). I was wondering what impact this has on password ageing, and therefore enforced password change. Does the NULL mean the account has never... (0 Replies)
Discussion started by: Lampers
0 Replies

10. UNIX for Dummies Questions & Answers

Trying to extract a field from /etc/passwd file..

Hello, was looking for some help on extracting a field from the passwd file. So far I have made a copy of the passwd file and changed my rights so I can edit it. Every user's password is coded as an :x:, and my goal was to change that x to a blank, and then try to extract any user with that field... (2 Replies)
Discussion started by: xBuRnTx
2 Replies
Login or Register to Ask a Question