www.linux-noob.com: Force password change - www.linux-noob.com

Jump to content

Page 1 of 1

Force password change Force password change

#1 User is offline   xDamox

  • Linux-Noob Frequent Member
  • PipPipPip
  • Group: Members
  • Posts: 390
  • Joined: 13-December 04

Posted 19 April 2006 - 02:16 PM

Hey all,

I thought I would do a little tutorial on how to force users to change their passwords when they first
login to the system.

Ok lets get started, first we will need to choose a user or create a users to enforce password chaning in my example
we will have a user called: znx ;) and we want him to change his password when he logs in.

The thing we need to do is lock the account to make sure he doesn't login until we have finished so we
can issue the following:

usermod -L znx


Now that znx's account is locked we can change the password expiry date to 0 so he will be forced
to change the password:

chage -d 0 znx


Now znx's password has expired and we can now unlock his account with the following:

usermod -U znx


Done, that's all that is require to make the user znx change his password. When znx attempts to login he will
be presented with:

You are required to change your password immediately (root enforced)
Changing password for znx
(current) UNIX password:


Notice they have to enter their CURRENT password first before having to enter a new one.
0

#2 User is offline   hybrid

  • Linux-Noob Frequent Member
  • PipPipPipPipPipPipPip
  • View blog
  • Group: Admin
  • Posts: 588
  • Joined: 30-July 05

Posted 19 April 2006 - 03:54 PM

Does this work with GUIs as well? And if so, does it look nice or do users get presented with a nasty terminal window?
My website | Portfolio

FOSSwire -- all about free and open source software, featuring tips, tricks, tutorials, reviews, articles and all the latest news from the free software universe.
0

#3 User is offline   xDamox

  • Linux-Noob Frequent Member
  • PipPipPip
  • Group: Members
  • Posts: 390
  • Joined: 13-December 04

Posted 19 April 2006 - 05:38 PM

Good question hybrid,

Last time I checked it did not work with X Windows :( I even emailed shadow man of the redhat magazine no reply
tho. If you do get it working with the GUI let me know :)
0

#4 User is offline   znx

  • Linux-Noob GURU
  • PipPipPipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 1,236
  • Joined: 21-March 05

Posted 19 April 2006 - 07:11 PM

a user like WHO ! .. i think this is copyright infringement :P
0

#5 User is offline   xDamox

  • Linux-Noob Frequent Member
  • PipPipPip
  • Group: Members
  • Posts: 390
  • Joined: 13-December 04

Posted 20 May 2006 - 07:10 PM

View Posthybrid, on Apr 19 2006, 03:54 PM, said:

Does this work with GUIs as well? And if so, does it look nice or do users get presented with a nasty terminal window?


On fedora core five it works excellent with X Windows really well handled :)
0

Page 1 of 1

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users





The G2-style Tux and the header images using them are licensed under Creative Commons BY-NC-SA. The G2-style Tux images are all from http://crystalxp.net.
Thanks to users kami23, lilitux, iva, overlord59, whidou, brightknight, emulienfou on the Crystal XP Tux Factory site.