Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

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

1 Answer 1

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|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.