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.