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.
Michael Durrant
  • 10,666
  • 21
  • 60
  • 81

1 Answers1

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
Florian Diesch
  • 86,013
  • 17
  • 224
  • 214