useradd: cannot lock /etc/passwd; try again later.

By | 2012/10/05

Can’t add a user in Linux because of this: ‘useradd: cannot lock /etc/passwd; try again later.’ ? Here’s what to check!

$ sudo useradd -m -g users -s /bin/bash jsmith
useradd: cannot lock /etc/passwd; try again later.

If you receive this message even when running with sudo, there are small lock files that are causing this.

Remove any files called


Careful to not remove the actual passwd or shadow files(!).

This error can also occur if the filesystem was mounted read-only. Check to be sure the file system is mounted read write.

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.