Forcing users to change their passwords
Results 1 to 6 of 6

Thread: Forcing users to change their passwords

  1. #1
    Senior Member
    Join Date
    Jul 2004
    Posts
    177

    Question Forcing users to change their passwords

    I guess that I'm not the first who ask that but i didn't found anything.

    I'm running FC 3 and I would like to create a user account that forces the user to change his/her password the first time he/she log in... I'm not using XWindows.

    I do the following to create it:

    Code:
    adduser -m -s /bin/bash usrname
    and then I set the password with:

    Code:
    passwd username
    Thank you all.

  2. #2
    Senior Member Cemetric's Avatar
    Join Date
    Oct 2002
    Posts
    491
    Hey,

    You need to pass the ‐e option to the passwd command.
    This in will force a user to change his/her password at the userís next login.

    Let's say the user name is bob then you would need to type as root :

    passwd -e bob

    The next time the user bob logs in he will get a message that he needs to change his password.

    Hope this is what you were looking for.

    [EDIT] I forgot to mention it is like this on a SUSE linux ...don't know if it is the same on a Fedora but I suppose it is...someone will correct me if I'm wrong ...there are some linux specialst here [/EDIT]

    [EDIT2] Have you done a passwd --help in the console ? Isn't it in there ? [/EDIT2]

    C.
    Back when I was a boy, we carved our own IC's out of wood.

  3. #3
    Senior Member
    Join Date
    Jul 2004
    Posts
    177
    Hi, thank you for the answer.

    I found this "-e" googling but it doesn't work for fedora

    Any suggestion?

  4. #4
    Senior Member Cemetric's Avatar
    Join Date
    Oct 2002
    Posts
    491
    I found a command on a redhat forum ...seeming this is the prerunner to Fedora it might work but you will need to test it.

    The command is "chage"

    You can give extra options like "-M days" this will give you:

    Specify the maximum number of days for which the password is valid. When the number of days specified by this option plus the number of days specified with the -d option is less than the current day, the user must change passwords before using the account.
    source

    see if you find this command on your system ?

    Apparently it should exist in Fedora according to this site

    C.
    Back when I was a boy, we carved our own IC's out of wood.

  5. #5
    Senior Member
    Join Date
    Jul 2004
    Posts
    177

    Talking

    Indeed that was the command!

    What I want to do is not to set an expiring password policy but force the user to set a proper password the first time he/she logs in. After some man reading (it isn't very intuitive ocmmand ) I solved the point in that way:

    Code:
    chage -M 9999 -d 1 username
    This sets the password expire date arround year 2033 and the last change of that password arround 1970, so the first time the user logs in he/she must change the password but afterwards it won't expire in 25 years....

    Thank you very much, I really appreciate your help.

  6. #6
    Senior Member Cemetric's Avatar
    Join Date
    Oct 2002
    Posts
    491
    Thank you very much, I really appreciate tour help.
    No prob..glad to help.
    Back when I was a boy, we carved our own IC's out of wood.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •