views:

41

answers:

2

I'm trying to use multiple parameters with the useradd command in linux, and I'm not really sure exactly what I should do?? I have tried the following:

useradd -b /home/ -g admin -m -p PASSWD -s USERNAME

Needless to say, it doesn't work. Can anyone tell me the correct syntax to get this working? Thanks, your help is always appreciated!

EDIT: I'm not getting an error message, It is just returning the flag variables followed by an ng

A: 

hmmmm maybe the MAN page: useradd

ennuikiller
You really think I'd ask such a question without reading the man page?
b.j.g
More like, [man stackoverflow](http://stackoverflow.com/faq), question 2.
TomMD
@b.j.g If you did read it and misunderstood it, then maybe you could re-read it and figure out what pieces you misunderstood?
Kaleb Pederson
A: 

The -s flag is for specifying the shell.

So either leave the -s flag out,

useradd -b /home/ -g admin -m  USERNAME

or specify a shell:

useradd -b /home/ -g admin -m -s /bin/bash USERNAME

PS. Don't specify the password on the command line. It would be visible to other users listing the processes. Moreover, specifying the password this way requires you to enter the encrypted password.

unutbu
I tried useradd -b /home/ -g admin -m -p PASSWD -s /bin/bash USERNAME ... didn't work.
b.j.g
@b.j.g: Please update your question to include what error message you get.
unutbu
I also tried leaving -s out, still doesn't work.
b.j.g