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. |
| 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.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-22-2003, 11:16 AM
|
#1
|
|
LQ Newbie
Registered: Dec 2002
Location: Novi, MI
Distribution: Red Hat
Posts: 25
Rep:
|
adduser not working - unable to lock passwd
I am running RH 7.2 (I think. It's 7.x for sure. It's been up for so long) as a samba and web server for internal network. Recently, I tried to add a user using linuxconf but did not work. I tried "useradd", but it could not be executed because it can not "lock the password file".
(exact output is - useradd: unable to lock password file)
I ended up adding the users by manually creating the
home directories and vi-ing the /etc/passwd and /etc/shadow
files, copying all the .bash* files etc. from another existing home directory, chown-ing (-R) the home directories, then running passwd <newuser>.
I ran fuser to see if there is any process (like another session of linuxconf I fogot to close, etc.) using passwd or shadow, but there seems to be no other process accessing the file.
Can anyone help me with figuring out what is going on?
Thanks.
|
|
|
|
05-23-2003, 09:22 AM
|
#2
|
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 907
Rep:
|
Re: adduser not working - unable to lock passwd
Quote:
Originally posted by Shin Takeshita
I am running RH 7.2 (I think. It's 7.x for sure. It's been up for so long) as a samba and web server for internal network. Recently, I tried to add a user using linuxconf but did not work. I tried "useradd", but it could not be executed because it can not "lock the password file".
(exact output is - useradd: unable to lock password file)
I ended up adding the users by manually creating the
home directories and vi-ing the /etc/passwd and /etc/shadow
files, copying all the .bash* files etc. from another existing home directory, chown-ing (-R) the home directories, then running passwd <newuser>.
I ran fuser to see if there is any process (like another session of linuxconf I fogot to close, etc.) using passwd or shadow, but there seems to be no other process accessing the file.
Can anyone help me with figuring out what is going on?
Thanks.
|
You can't add a user unless you are suid
So try that with root and it should work.
Last edited by rch; 05-23-2003 at 09:24 AM.
|
|
|
|
05-23-2003, 11:30 AM
|
#3
|
|
LQ Newbie
Registered: Dec 2002
Location: Novi, MI
Distribution: Red Hat
Posts: 25
Original Poster
Rep:
|
I have executed su.
Note that I was able to vi /etc/passwd and /etc/shadow.
If I were not root, I wouldn't be able to do that.
I am not daring enough to give anything more than 644 and 400, respectively, to these files.
The error message was not that I do not have write priviledge to the password file, but "unable to lock."
|
|
|
|
05-27-2003, 09:41 AM
|
#4
|
|
Member
Registered: Feb 2003
Location: Santa Clara,CA
Distribution: Mandriva
Posts: 907
Rep:
|
Quote:
Originally posted by Shin Takeshita
I have executed su.
Note that I was able to vi /etc/passwd and /etc/shadow.
If I were not root, I wouldn't be able to do that.
I am not daring enough to give anything more than 644 and 400, respectively, to these files.
The error message was not that I do not have write priviledge to the password file, but "unable to lock."
|
I had similiar problem like yours when I was trying to change my password over telnet.The password file /etc/passwd needs to be locked to access it(means that it should not be used by anybody else(or any other process)).Maybe you are familiar with the locks in /var/.So I ask you whether you were changing the password through the network or anything else was using it?
You can't use 400 coz if some user other than root try to access it he will be denied.
You can try 744 normally as it would not compromise your security.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:34 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
|
|