Receiving error “Useradd: unable to lock password file” on linux


I got the below error when running the useradd command on  linux.

“Useradd: unable to lock password file

This issue occurs if there is passwd.lock or passwd-  or passwd~ file in the /etc/directory. You can remove it or move to some other directory to fix the issue and restart the server. Sometimes you will not be able to move as well and if that’s the case, then you need to restart linux server to fix the issue.

 

Advertisements

5 Comments

Filed under Linux

5 responses to “Receiving error “Useradd: unable to lock password file” on linux

  1. Saravananan

    how this file will generate

  2. Saravananan

    what is the reason for this error

    • Usually, this happens when the previous attempt to add a user, remove user, password change, adding or removing group etc., was completed, but fails to remove its lock on that file causes the issue.

      • Ankita Mohan

        I had the same issue once .
        Creating “mahanc” on adela192p.noa.alcoa.com by executing
        ssh adela192p.noa.alcoa.com /usr/sbin/useradd -u 80298 -c “GBS_UNIX_USR,chg,chhanda.mahanty@alcoa.com,GIS-ADC,,” -d /home/mahanc -m -s /bin/bash mahanc
        useradd: unable to lock password file
        ERROR creating account on adela192p!.

        but the server didnt had /etc/passwd.lock file 😦
        The issue was due to the /root which was 100 % utilized.

      • thanks for the new resolution 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s