With several commands I get the error "cannot lock /etc/passwd; try again later". Does anybody know how to solve it? Also I don't get in my /etc/shadow directory.

link|improve this question
you have to raise your user level by using "sudo" or "su" command. – Shivan Raptor Jun 13 '11 at 7:18
2  
Your /etc/shadow directory?!? /etc/shadow should be a file. Please give the exact command you're trying to execute. – Brian White Jun 15 '11 at 11:04
In my case root filesystem was full :-p – Saarbuntu Feb 5 at 22:20
feedback

migrated from stackoverflow.com Jun 13 '11 at 7:45

This question came from our site for professional and enthusiast programmers.

3 Answers

That's because you don't have permissions for those operations

  • You can't read /etc/shadow
  • You can't directly modify /etc/passwd

You can change both files through specialized commands (e.g you can change your password).

link|improve this answer
to change password, use " passwd <username> " – Shivan Raptor Jun 13 '11 at 7:21
feedback

The user you are running the commands as lack the required privileges. Change to root user by issuing the command

su -

or if you have/use sudo

sudo <command to run>
link|improve this answer
feedback

This can also be caused by running out of space on the root filesystem. Use strace to be sure. strace is your friend.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown