How to Add User to Linux Usergroups
Linux is a very famous operating system. A lot of people are using this system, and you can also take advantage of this fact. If you want to be an administrator of your own usergroup, you can also add your user into the group. You just need to do some steps before you actually add your user. Follow these steps and be successful in gaining admin privileges for your user group.
Let’s assume that we have a user ” Administrator” in the group “Domain Admin”. We will enter his userid and pass the group memberships as “Domain Admin”. In order to add the user into the group, run the following command: su – adduser –userid=administrator Now when this command is finished, you will see a message in form of: SUCCESSfully added ” Administrators” to group “Domain Admin”.
Another way to add user into group is to create the symbolic link on the user’s file system. You can create the link under the user’s home directory or the directory where Linux stores the log files. The file that will be created should point to the user’s home directory.
If your Linux distribution does not allow to install usergroups, then you can try to use the su command. On the login screen, type su – adduser. For example, if your username is “admin” and you have been added to the “Domain Admin” group, type su – adduser “Domain Admin”. It will display a screen similar to the following one: SUCCESSfully added “Domain Admin” to group “Domain Admin”. If everything went well, you will be asked for your new password. Use the password you just created.
One of the advantages of this method is that you can create usergroups even if you do not have access to the Linux kernel. Also, adding users is not affected by kernel security patches. However, Linux systems do not allow you to add user to groups if you are not also doing root tasks. For instance, you cannot load your file manager software if your system has disabled the root privileges. You can only execute such commands when you are logged as the “uid” user.
If you are not interested in using the su command and want to add user to a specific group, you can use the chroots utility. It is a part of the Linux kernel and is also available as a package. chroots allows you to create virtual directories within your Linux OS using the chroot command.
To add user to a usergroup, use the chroots command again, but this time enter your home directory as your user. Type the chroots command like the root user and enter a password for your account. Enter the new user name and enter userid where you want the new user to be identified. reboot your Linux OS and log in as the new user. The change will take place on the login environment of the Linux OS.
Use “pwd” to be able to view the files owned by the user “uid” and the group associated with “user”. Type “cduser” to cd into your user directory if you want to change to the user’s home directory. Use “mountfs” to mount your home directory on your Linux OS. Type “iptables” to configure the firewall settings on your Linux OS. The last step is to reboot your computer and see the changes on the login prompt.
To add user to your usergroup, use the su command in your Linux terminal. This will switch you to the root user and grant permission to access the files you specified. For more detailed information on su, refer to the “manual” man page for your distribution. Add the user ID and the group ID you want to be a member of. The usergroup command will display the newly created user group.
To add user to your Linux usergroup, use the su command again but enter your home directory as the user. Type “cduser” to cd into your home directory as your user and grant permission to access the files you specified. reboot your Linux system to complete the installation.
You can also add user to your Linux group anytime you want. There are two ways to get the user group permissions you want: either by manually adding the user or by using the Linux su package. With su, you are granted full control over your usergroups, and it is much easier than doing it the manual way.