Useradd Cannot Lock etc passwd Try Again Later
ix Answers 9
If no .lock files are present but yous still cannot create a user try the following
sudo mount -o remount,rw / If logged in equally root then use
mount -o remount,rw /
Jawa
3,559 xiii gold badges 30 argent badges 36 bronze badges
answered Oct three, 2022 at 7:22
4
The user y'all are running the commands every bit lack the required privileges. Change to root user by issuing the control
su - or if you have/use sudo
sudo <command to run> answered Jun 13, 2011 at 7:18
inquaminquam
303 one silver badge eight bronze badges
If you have -R /some/chroot added to your useradd command, that might exist the problem.
I idea it meant that the user would be jailed upon login, but that'south non the example. Past looking at strace output, I saw useradd chrooted into the specified directory, afterwards which of course it cannot find /etc/passwd anymore. Then I'm not sure what the option is for, just there'south your (well, my) problem.
answered Jun 17, 2022 at 20:17
LucLuc
2,363 ii gold badges 23 silvery badges 34 bronze badges
two
-
This was exactly what I was trying. After removing the
-R [dir]option I was able to create the user.October 11, 2022 at eighteen:55
-
Nice guess! Cheers. I as well understood that the chroot for
useraddis not what you think it is :) It just uses the specified dir as a root for the user's organization. Information technology's useful for cloned isolated sub-OS, which is rarely what you desire...Sep 7, 2022 at xiii:45
That's considering you don't have permissions for those operations
- You lot can't read
/etc/shadow - You can't straight alter
/etc/passwd
You can modify both files through specialized commands (e.yard you tin change your password).
answered Jun thirteen, 2011 at 7:16
1
-
to alter password, use " passwd <username> "
Jun 13, 2011 at seven:21
I ran into this when a disk error occurred during a userdel operation and the system had to exist rebooted. I needed to delete all 4 of the post-obit files to proceed:
sudo rm /etc/passwd.lock sudo rm /etc/shadow.lock sudo rm /etc/group.lock sudo rm /etc/gshadow.lock answered Aug ii, 2012 at 21:xx
This tin can besides be caused past running out of space on the root filesystem. Utilize strace to exist certain. strace is your friend.
answered January 28, 2012 at 22:12
Robin GreenRobin Green
1,263 i gilt badge 12 silvery badges 28 bronze badges
2
-
I've been reading many threads with my trouble and that was actually the solution. Should be ane of the showtime things to check when having any filesystem issues, I guess. I'm using
dfinstead ofstracethough. How wouldstracehelp me? Never used information technologyApr xiv, 2022 at x:xi
-
Well, if y'all already guessed that the problem might exist running out of space, then df tin can help. But strace will tell y'all what the error code was when information technology tried to lock the file, so it should remove the guesswork. The mode I usually call strace is
strace -f -e trace=filecontrol since this usually gives the most useful results.Apr 14, 2022 at 11:03
A demo of this error on Ubuntu 14.04:
user@mybox:/home$ sudo useradd eric user@mybox:/dwelling house$ userdel eric userdel: Permission denied. userdel: cannot lock /etc/passwd; endeavour again later. sudo gives you the permission to lock information technology.
user@mybox:/dwelling$ sudo userdel eric user@mybox:/home$ answered Sep 17, 2022 at 20:45
Eric LeschinskiEric Leschinski
six,448 6 gilt badges 43 silvery badges 49 bronze badges
answered May nineteen, 2022 at 23:45
Had aforementioned issue, since /etc was full. This is why /etc/passwd could not be written. Make sure that you accept plenty space on /etc, if not then enlarge it or make clean unnecessary stuff.
answered Jan 3, 2022 at 15:39
Source: https://superuser.com/questions/296373/cannot-lock-etc-passwd-try-again-later
This solved the issue I had after booting into recovery mode past editing the grub entry
Feb 1, 2022 at 8:xvi
simply where shall i wait for the
.lockfiles? thanks to @trevorRobinson information technology seems one should look in/etc/, correct?February 13, 2022 at thirteen:32
What if it says
mountain: cannot remount /dev/dm-0 read-write, is write-protected. I'grand in ChromeOS (Linux) with Dev Mode enabled.Apr 22, 2022 at 5:51
Why isn't this the accepted answer??
Jul xx, 2022 at 7:22