Here’s how to add an existing user to a user group in Linux.
usermod -a -G groupname username usermod -a -G www-data john |
List all users belonging to a group.
lid -g www-data |
List all the groups the user belongs to.
groups john |
cloud engineer
Here’s how to add an existing user to a user group in Linux.
usermod -a -G groupname username usermod -a -G www-data john |
usermod -a -G groupname username usermod -a -G www-data john
List all users belonging to a group.
lid -g www-data |
lid -g www-data
List all the groups the user belongs to.
groups john |
groups john