LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 05-16-2007, 06:26 AM   #1
manya
Member
 
Registered: Apr 2004
Posts: 194

Rep: Reputation: 15
How to change password at first logon on FC3


Hi Guyz,

Can anyone help me here in setting up my FC3 system, so that i can force user to change their password at first logon

Your help would be very much appreciated.

Thanks and Regards,
Manya
 
Old 05-16-2007, 06:30 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
That,s easy - supply a random password of a dozen or so characters and they will clamor to change it.
 
Old 05-16-2007, 06:35 AM   #3
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
Hmmm..thats not the answer i am looking for, i need to know if e.g. root user sets password for one user and if logson to machine with given password, system should prompt him to change the password !!

any clue, on how to achieve this

Regards,
Manya
 
Old 05-16-2007, 01:52 PM   #4
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
login script

Note: the annoying random password is what everyone does.
 
Old 05-16-2007, 11:25 PM   #5
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
Hey Simon,

Thanks for the hint..... but any idea or are you aware of any such script availaible on net
 
Old 05-17-2007, 12:58 AM   #6
Kristijan
Member
 
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394

Rep: Reputation: 30
Only thing I can think of is setting the lifetime of the password with -n

Code:
passwd -l -n 3 <user>
That sets the life of the password to 3 days. Works well if you know the users are going to login on a particular day.

-Kristijan
 
Old 05-17-2007, 01:31 AM   #7
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
The login script is available on your computer... you could make it run a password changing routine at some stage.

My latest effort made changing the password part of a tutorial and those taking the course got a grade for being able to do this

So I still think you need to look to what you hope to achieve (why is it so critical that users change their password right away?) and use a management strategy to address this.
 
Old 05-17-2007, 06:36 AM   #8
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Use the "-e" option to the passwd command. It will force the user to change the password at the next login.

There may be a configuration option in your new users dialog that will do this as well.
 
Old 05-17-2007, 01:56 PM   #9
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
jschiwal,

-e option does not work with Red Hat or Fedora, i guess it works only with Suse Linux, I tried doing that but couldnt succeed.

Any Other idea, Guyz !!
 
Old 05-17-2007, 02:56 PM   #10
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
open your /etc/shadow file... look for the line of the account... change the third field to a zero... for example, change this:
Code:
example_user:$1$3.QjW7vl$YJFyJNVwKmmWRYfeByMKe/:13650:0:99999:7:::
to this:
Code:
example_user:$1$3.QjW7vl$YJFyJNVwKmmWRYfeByMKe/:0:0:99999:7:::
just my ...
 
Old 05-17-2007, 03:36 PM   #11
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Or write a script, which should run at user login, force him to enter a password and run this to change: http://search.cpan.org/~eestabroo/Passwd-Linux-0.70/
 
Old 05-17-2007, 10:09 PM   #12
frob23
Senior Member
 
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450

Rep: Reputation: 48
Most systems have a method of putting it into the password file. That would be the correct way to do it. I have been known to use the script method... but therein lies madness.
 
Old 05-19-2007, 10:30 AM   #13
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
Hey Win32Sux

You da man !! Dude it worked, thanks a lot man for helping me out
 
Old 05-20-2007, 05:36 AM   #14
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
here is an easy fix for all new users


cd /etc/skel
mv .bashrc .bashrc.old

vi .bashrc
Code:
#!/bin/bash
# trap all break keys
trap "" SIGINT 2> /dev/null
trap "" SIGKILL 2> /dev/null
trap "" SIGSTOP 2> /dev/null

 while [ "1" = "1" ]; do
   password && break   #if successful password change it will break the loop
 done

trap - SIGINT
trap - SIGKILL
trap - SIGSTOP
mv .bashrc.old .bashrc
and when you create the account it will copy and run at first login
 
Old 05-20-2007, 02:02 PM   #15
slimm609
Member
 
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430

Rep: Reputation: 67
are you wanting to do it for all new members?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 a user to change their NIS password at logon? synthol6 AIX 1 08-17-2010 09:47 PM
no local host logon or password Bubba1008 Linux - Newbie 4 04-25-2006 09:48 PM
logon and password recovery Ron Moroney Linux - Newbie 5 04-08-2005 02:15 PM
Help with password logon window wardialer Linux - Newbie 3 04-08-2005 03:24 AM
set logon password without useradd? ldp Linux - Security 2 01-22-2005 08:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:42 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