4

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.
  • note that useradd's -p expects an encrypted password. Consider using newusers instead. – geirha Jun 9 '12 at 10:08
8

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.