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.
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.
|
 |
03-01-2004, 01:58 AM
|
#1
|
LQ Newbie
Registered: Mar 2004
Distribution: RH 9
Posts: 8
Rep:
|
sudo :adduser: unable to lock password file
Hey,
I know this has been asked a million times, but it hasn't provided a resolution for me. I'm new, and ignorant with terminology, but I'm eager to learn.
THE POINT
I wanna be able to allow people to create a webspace on my server. FTP/Web Account, and email. I'm using a php form, posting to a cgi script.
...
system ("/usr/bin/sudo -u bob /usr/sbin/adduser $userid -c '$f_name $l_name' -p $password");
I have "bob" in the sudoers file as "bob ALL=(ALL) ALL"
I keep getting adduser: unable to lock password file. Can someone please tell me what that is and why I'm getting it and how to resolve it. I deleted the .lock files too. I'm going nuts.
Thanks
Kareem
|
|
|
03-01-2004, 04:24 AM
|
#2
|
Member
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162
Rep:
|
My guess (and it's more a guess here than anything else) is that bob needs to be authenticated before changing the file. (I don't see how you are typing in a password here) And because that authentication uses the password file, you cannot lock it to then change it.
That's my guess at least.
-G
|
|
|
03-01-2004, 10:50 AM
|
#3
|
LQ Newbie
Registered: Mar 2004
Distribution: RH 9
Posts: 8
Original Poster
Rep:
|
ok so how would I go about doing that? https?
Thanks
Kareem
|
|
|
03-01-2004, 03:22 PM
|
#4
|
Member
Registered: Jul 2003
Distribution: Arch .5 and Solaris 9/10
Posts: 162
Rep:
|
Try setting NOPASSWD: ALL
or NOPASSWD: adduser
That should work. Also: You really need to change the ALL=ALL to something a little more secure. Protect the root. Always remember that.
-G
|
|
|
03-19-2004, 01:42 PM
|
#5
|
LQ Newbie
Registered: Mar 2004
Location: New York City
Distribution: Fedora Core 3
Posts: 4
Rep:
|
Solution to problem
I've just encountered this same problem after upgrading a RH 7.2 box to FC1
The problem was the password lock files (obviously) but also quite literally.
I did the following:
Code:
mv /etc/passwd.lock /etc/passwd.lock.bak
and then repeated it for:
group.lock
gshadow.lock
shadow.lock
after doing this, i could add and remove users again.
|
|
|
03-27-2004, 01:38 AM
|
#6
|
LQ Newbie
Registered: Mar 2004
Distribution: RH 9
Posts: 8
Original Poster
Rep:
|
Still no luck...
# sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
#
# Host alias specification
# User alias specification
# Cmnd alias specification
# Defaults specification
# User privilege specification
root ALL = (ALL) ALL
apache ALL = (ALL) NOPASSWD: /usr/sbin/adduser
i tried adduser and /usr/sbin/adduser
either way it says the same.. "adduser: unable to lo
ck password file"
I searched and deleted any .lock files. I don't have any..
system ("/usr/bin/sudo -u apache /usr/sbin/adduser $userid -p $password");
i've been taking out flags to minimize errors.. no luck..
any ideas?
Kareem
|
|
|
03-28-2004, 01:53 AM
|
#7
|
LQ Newbie
Registered: Mar 2004
Distribution: RH 9
Posts: 8
Original Poster
Rep:
|
Hey I got it to work..
yay
now if i can only get sendmail working correctly.. lol
thanks
kareem
|
|
|
05-19-2004, 05:50 PM
|
#8
|
LQ Newbie
Registered: May 2004
Distribution: rh9
Posts: 1
Rep:
|
hey,
i´d like to know how you did it...
i´m having the same problem you had!
thank you in advance...
by the way, i´m using rh9...
Last edited by hardcode; 05-19-2004 at 05:57 PM.
|
|
|
07-23-2004, 01:22 AM
|
#9
|
LQ Newbie
Registered: Jul 2004
Posts: 2
Rep:
|
Hi khamdy
Could you be so kind and tell us what was involved in resolving this issue.
regards
Lawton
|
|
|
10-13-2010, 06:26 AM
|
#10
|
LQ Newbie
Registered: Oct 2010
Posts: 1
Rep:
|
lock file
I had same problem, the problem is with lock files
check for /etc/.*lock
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 09:32 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
|
|