Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 05-02-2003, 05:01 AM   #1
LQ Newbie
Registered: May 2003
Posts: 19

Rep: Reputation: 0
/etc/passwd help

Can anyone tell me how /etc/passwd gets updated when a new user is added. I need to maintain a file similar to /etc/passwd thats updates itself when /etc/passwd gets updated. Can anyone tell me how i can do this?

Old 05-02-2003, 06:02 AM   #2
Senior Member
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Well usually it's done through the useradd command. But it's also possible to manually update /etc/passwd with for example vipw.

You could always write a wrapper script for the useradd command which also updates your other file. But that wouldn't include updates which are done through other methods. You could also create a cron script which checks for updates to the /etc/passwd by maybe checking the modified timestamp and then updating your other file accordingly.

Maybe you would like to explain a little more what needs to get updated in the similar file? Is this only a list of names or is this also dependant on other changes in the /etc/passwd file? Like if someone changes their shell.
Old 05-09-2003, 05:02 AM   #3
LQ Newbie
Registered: May 2003
Posts: 19

Original Poster
Rep: Reputation: 0

What I actually want to do is maintain a file that holds all the groups and the users under that i need to update my file when ever a new user and group gets added...

I have no idea about cron scripts and what they do. If you can tell me something about it or tell me where I can read up that would be very helpful

Thanks for the help

Old 05-09-2003, 01:28 PM   #4
LQ Guru
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
man cron would be a good start cron service executes some user predefined tasks on user predefined time intervals.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/passwd XaViaR Linux - General 1 06-13-2005 10:12 AM
passwd romel Linux - Security 1 04-25-2004 01:12 AM
about passwd jnzhang Linux - General 7 07-08-2003 04:32 PM
can't passwd leihsun Linux - General 17 06-19-2002 05:37 AM
passwd Winter Linux - Security 2 05-01-2002 05:13 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:30 PM.

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