1

I am trying to update the password policy for a user. It should be as follows:

  • Must be changed every 30 days
  • Once changed, cannot be changed for 3 days
  • Must be disabled after 45 days of inactivity

I tried using the passwd command to set this up:

passwd -f -e -u -n 3 -x 30 -w 7 -i 45 theuser

After running this, I see the following error:

passwd: Only one of -l, -u, -d, -S may be specified.

Looking at this, I am only using one of those listed flags, -u. Why is passwd giving me this error?

I've been messing with the flags and cannot get this working. I also got the following error, but cannot remember what flag combo I used to get it though:

passwd: Cannot mix one of -l, -u, -d, -S and one of -i, -n, -w, -x.

2
  • 1
    and what about this: passwd -n 3 -x 30 -w 7 -i 45 theuser. It seems that -e flag is messing it.
    – taliezin
    Mar 8, 2015 at 21:28
  • @taliezin: That worked. Removing the -e, -f and -u flags fixed it.
    – gen_Eric
    Mar 8, 2015 at 21:36

1 Answer 1

0

I think you need to use the chage command

Usage: chage [options] [LOGIN]

Options:
  -d, --lastday LAST_DAY        set date of last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS

[

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .