LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 01-16-2009, 10:20 AM   #1
le_forban
LQ Newbie
 
Registered: Jan 2008
Location: Brittany, France
Distribution: RHEL4&5
Posts: 7

Rep: Reputation: Disabled
Smile RH 5.2 - First login: Force root password change


Hello y'all

I have been dabbling with kickstart for a while now and I am looking for the best way to force the "root" user password change at their first login.

Why is that ? I provide a boot CD with a default password set in kickstart and I want the users to change this password so discovering the default password would be useless for attackers.

So far, I used to modify /root/.bashrc to call a script such as this one:

#!/bin/sh

passwd root

# Take off ${0}from the bashrc file
cat /root/.bashrc | sed s/${0}// > /root/.bashrc.tmp
cp -f /root/.bashrc.tmp /root/.bashrc

But I don't really like that solution so I tried to use the ageing commands in the %post section of kickstart:

change -d 0 root

Unfortunately, it doesn't seem to work, anybo dy got a better solution ?

Thank you very much for your help.

Richard

Last edited by le_forban; 01-16-2009 at 10:29 AM.
 
Old 01-17-2009, 10:25 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Try:
# chage -M 3650 -d 1975-01-01 root

Last edited by anomie; 01-17-2009 at 10:27 PM.
 
Old 01-20-2009, 07:24 AM   #3
le_forban
LQ Newbie
 
Registered: Jan 2008
Location: Brittany, France
Distribution: RHEL4&5
Posts: 7

Original Poster
Rep: Reputation: Disabled
Thank you Anomie, I mistook "change" for "chage", the latter works fine and forces the change.

However, in my case I get a strange behaviour: When I use chage to force the password change, this means that I have to enter the actual password twice before entering the new one (one for login and one for password change), a bit on the heavy side. It also curiously changes the required password strength (cannot force the use of a simple password for tests purposes for instances).

I will probably carry on using a simple "passwd root" in a script file called at login for those last bad reasons but your answer was absolutely correct and a valuable tip, thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to force user to change password after expiration in Linux? ssy68 Linux - Newbie 4 06-30-2011 02:54 PM
How to force a user to change their NIS password at logon? synthol6 AIX 1 08-17-2010 08:47 PM
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 10:28 PM
Password Check is Passwords Skipped in Login Screen, Root System Settings Change in X edwardt Red Hat 1 07-06-2004 11:46 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 10:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration