Question

I'm trying to add a user with this command:

#!/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?

Was it helpful?

Solution

change --group to --gid

and find id by group name like this:

APPGROUP=`grep "test2" /etc/group|cut -d: -f3`

adduser -c 'uwsgi user' --gid $APPGROUP --system --no-create-home --disabled-login --disabled-password $APPUSER   
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top