5

I've created a new user for FTP.

useradd -g www-data -d /srv/www/vhosts/project/ black

I made a mistake, I actually need the user to be in the group www.

How can I change the group?

6

You can use:

sudo groupadd www # Add a new group, if not exists
usermod -a -G www black # Add the existing user black to www
usermod -g www black # Change the primary group of black to www

To confirm that it has been added:

groups black

From removing user from secondary group, in this case www-data group:

gpasswd -d black www-data

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.