Linux: Add user to group - with this command it is possible
In Linux you have the possibility to add users to certain groups. Thus, it is possible to access the permissions of certain files. While in some Linux distributions you can perform these settings through the user management, it is also possible to do this through a terminal command.
How to add a user to a group
In Linux, you have several ways to add a user to a specific group and thus set access rights. On certain Linux distributions, you can perform group assignment through the user management. In Linux-Mint, this is done by opening the Start menu and clicking on "Users and Groups". Select the "Users and Groups" application and enter your login information. Under "Users" you can now select the affiliation next to "Groups". Alternatively, this can also be done via the terminal.- Open the terminal so that you can enter commands.
- Note that both the user and the group must exist for the command.
- Then enter the command "sudo usermod -aG [group name] [user name]". However, replace [group name] and [username] with the exact names of the group and the user.
- Once you tag a command with "sudo", you want to specify it with root privileges. Aus diesem Grund werden Sie nach Eingabe des Befehls für gewöhnlich aufgefordert, Ihr Passwort einzugeben.