Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-16-2007, 06:26 AM
|
#1
|
Member
Registered: Apr 2004
Posts: 194
Rep:
|
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
|
|
|
05-16-2007, 06:30 AM
|
#2
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
That,s easy - supply a random password of a dozen or so characters and they will clamor to change it.
|
|
|
05-16-2007, 06:35 AM
|
#3
|
Member
Registered: Apr 2004
Posts: 194
Original Poster
Rep:
|
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
|
|
|
05-16-2007, 01:52 PM
|
#4
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
login script
Note: the annoying random password is what everyone does.
|
|
|
05-16-2007, 11:25 PM
|
#5
|
Member
Registered: Apr 2004
Posts: 194
Original Poster
Rep:
|
Hey Simon,
Thanks for the hint..... but any idea or are you aware of any such script availaible on net
|
|
|
05-17-2007, 12:58 AM
|
#6
|
Member
Registered: Sep 2003
Location: Melbourne, Australia
Distribution: NetBSD 3.0.1, Slackware 10.1
Posts: 394
Rep:
|
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
|
|
|
05-17-2007, 01:31 AM
|
#7
|
LQ Guru
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211
Rep:
|
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.
|
|
|
05-17-2007, 06:36 AM
|
#8
|
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
05-17-2007, 01:56 PM
|
#9
|
Member
Registered: Apr 2004
Posts: 194
Original Poster
Rep:
|
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 !!
|
|
|
05-17-2007, 02:56 PM
|
#10
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
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 ...
|
|
|
05-17-2007, 03:36 PM
|
#11
|
Senior Member
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247
Rep:
|
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/
|
|
|
05-17-2007, 10:09 PM
|
#12
|
Senior Member
Registered: Jan 2004
Location: Roughly 29.467N / 81.206W
Distribution: OpenBSD, Debian, FreeBSD
Posts: 1,450
Rep:
|
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.
|
|
|
05-19-2007, 10:30 AM
|
#13
|
Member
Registered: Apr 2004
Posts: 194
Original Poster
Rep:
|
Hey Win32Sux
You da man !! Dude it worked, thanks a lot man for helping me out
|
|
|
05-20-2007, 05:36 AM
|
#14
|
Member
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430
Rep:
|
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
|
|
|
05-20-2007, 02:02 PM
|
#15
|
Member
Registered: May 2007
Location: Chas, SC
Distribution: slackware, gentoo, fedora, LFS, sidewinder G2, solaris, FreeBSD, RHEL, SUSE, Backtrack
Posts: 430
Rep:
|
are you wanting to do it for all new members?
|
|
|
All times are GMT -5. The time now is 08:42 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|