7

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?

  • What's your OS? adduser varies by OS and even distro. – jordanm Mar 3 '14 at 15:08
  • Sorry, its debian – Jimmy Mar 3 '14 at 15:08
  • I should have noticed the Debian tag. – jordanm Mar 3 '14 at 15:09
  • Try running the script using set -x. It should show you the complete command that gets run. – Jenny D Mar 3 '14 at 15:17
9

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.

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.