[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: add user ?

Sasha Sobol writes:
>Yes, but my adduser script is too old and has some bugs.
>I want to modify file /etc/passwd&/etc/group in a secure way.
>I DO NOT want passwd program to write to my /etc/passwd while I didn't
>finish writing to it.

Since relatively few people are using PAM with any distribution
other than Red Hat Linux, I'll assume that's what you are using.
In Red Hat Linux, the password file is locked with the /etc/.pwd.lock
file, and I have seen the passwd program say that the password
database is locked and that the user should try again later when I
tried to use it while adding a user.

>I also do not wand login program to read a passwd file thet is not

Assuming you are using Red Hat Linux, usercfg does what you want.
It writes to passwd.new, group.new, and shadow.new, and then moves
them into place when they are completely written.  Readers get one
file (before the change) or the other (after the change) with no
state in between.

Or write your own script that does the same thing -- there's nothing
magical about it.  But pam isn't designed to handle adding users,
only manipulating existing ones.


"Ever wonder why the SAME PEOPLE make up ALL the conspiracy theories?"

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] []