useradd: cannot lock /etc/passwd; try again later
30,872
You need to run useradd
with root privileges, for example by using sudo
:
sudo -- useradd -c "test" -d /home/bbbbbbbb -e "01-jan-2013" -f 10 -g admin -p secretfgjdhdgd -s /bin/bash -u 123456 blobblob
Related videos on Youtube
Author by
Michael Durrant
Updated on September 18, 2022Comments
-
Michael Durrant over 1 year
Trying to add a user:
useradd -c "test" -d /home/bbbbbbbb -e "01-jan-2013" -f 10 -g admin -p secretfgjdhdgd -s /bin/bash -u 123456 blobblob
but getting:
useradd: cannot lock /etc/passwd; try again later.
-
geirha almost 12 yearsnote that
useradd
's -p expects an encrypted password. Consider usingnewusers
instead.
-