Add or Remove Users in Linux Groups
After setting appropriate permissions and "www-data" ownership to files and directories in the www folder, authorized users can be added as needed to the "www-data" group to enable viewing and editing. Such users can then be removed when the tasks are done.
==========
1. Add a user to the "www-data" group.
user@host: $ sudo usermod -a -G www-data username
2. Check if such user has been added to the group.
user@host: $ groups username
3. The added user needs to log out and log in again for the changes to take effect. Alternatively, such user can log in to the new group in the current command-line session, without logging out the user account, using the following command.
user@host: $ newgrp www-data
4. Remove a user from the "www-data" group.
user@host: $ sudo gpasswd -d username www-data
==========
user@host: $ sudo gpasswd -d username www-data
==========
Comments
Post a Comment