I'm trying to add a user into two groups when creating a new account. Now I use this command;
adduser --gid 33 --home /home/wwwroot/domain.com --force-badname %USER%
and then
usermod -a -G group user (let say GID is 1008)
I do this for each new user on a webserver to use SFTP (GID 1008)
.
What i want to do is this:
adduser + group + group
adduser --gid 33,1008 --home /home/wwwroot/domain.com --force-badname %USER%
Unfortunately this doesn't work this way.
Any suggestions?
useradd -G group1,group2 username
Each group name is separated by a comma, with no intervening spaces. – Benny Oct 18 '16 at 13:17