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

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .