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?

1 Answer 1

7

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
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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