adduser: Specify only one name in this mode

13,974

Option --group doesn't support any arguments unless you intend to create the given group. But it seems like you cannot add a new user and a (different) new group at the same time.

What are you trying to do? Are you looking for option --ingroup instead? Otherwise you have to create the group first. Then run adduser a second time to add a new user to the existing group.

Share:
13,974
Paul Smith
Author by

Paul Smith

Updated on September 18, 2022

Comments

  • Paul Smith
    Paul Smith over 1 year

    I'm trying to add a user with this command on my debian server:

    #!/bin/bash
    
    APPUSER="test1"
    APPGROUP="test2"
    
    # User
    adduser -c 'uwsgi user' --group $APPGROUP --system --no-create-home --disabled-login --disabled-password $APPUSER
    

    However it tells me I can only specify one name, but I am only specifying one name as far as I can see.

    What's going wrong?

    • Admin
      Admin about 10 years
      What's your OS? adduser varies by OS and even distro.
    • Admin
      Admin about 10 years
      I should have noticed the Debian tag.
    • Admin
      Admin about 10 years
      Try running the script using set -x. It should show you the complete command that gets run.