HI i had a small query, i wanted to know if it is possible to create a home directory for a particular user by just editing the /etc/passwd file.
Suppose for eg : i have abt 1000 unix users, and due to some unforseen reasons my server crashes, however i have copy of the /etc/passwd and /etc/shadow file , Now is there a way to directly add those ( 1000 odd user ) to my system with out actually manually using the useradd command
( yes, it is possible to write loop script that will read the /etc/passwd file and create the users ) but is there any other way to do this.
thanks for your feed back
On Tue, May 20, 2008 at 05:21:28PM +0530, Agnello George wrote:
HI i had a small query, i wanted to know if it is possible to create a home directory for a particular user by just editing the /etc/passwd file.
No.
Suppose for eg : i have abt 1000 unix users, and due to some unforseen reasons my server crashes, however i have copy of the /etc/passwd and /etc/shadow file , Now is there a way to directly add those ( 1000 odd user ) to my system with out actually manually using the useradd command
chpasswd(8)
Devdas Bhagat
On 20-May-08, at 6:16 PM, Devdas Bhagat wrote:
Suppose for eg : i have abt 1000 unix users, and due to some unforseen reasons my server crashes, however i have copy of the /etc/passwd and /etc/shadow file , Now is there a way to directly add those ( 1000 odd user ) to my system with out actually manually using the useradd command
chpasswd(8)
can also be done with webmin
On 5/20/08, Kenneth Gonsalves lawgon@au-kbc.org wrote:
On 20-May-08, at 6:16 PM, Devdas Bhagat wrote:
Suppose for eg : i have abt 1000 unix users, and due to some unforseen reasons my server crashes, however i have copy of the /etc/passwd and /etc/shadow file , Now is there a way to directly add those ( 1000 odd user ) to my system with out actually manually using the useradd command
chpasswd(8)
can also be done with webmin
while checking out the chpasswd i can accross the newuser command
i manually added the following line in my /etc/passwd file then i ran the "newuser" command meghanand:x:2010:2010::/home/website/meghanand.com:/sbin/nologin
#newusers /etc/passwd
this created the the home dir /home/website/meghanand.com
:-)
On Tuesday 20 May 2008, Agnello George wrote:
HI i had a small query, i wanted to know if it is possible to create a home directory for a particular user by just editing the /etc/passwd file.
Suppose for eg : i have abt 1000 unix users, and due to some unforseen reasons my server crashes, however i have copy of the /etc/passwd and /etc/shadow file , Now is there a way to directly add those ( 1000 odd user ) to my system with out actually manually using the useradd command
You could manually do the things that useradd does (assign new userID, create passwd entry, create group entry, create shadow entry, create home directory, etc.), but why would you want to reinvent the wheel when useradd already does all that so well?
Regards,
-- Raju