Adding Users To A Usergroup

Using the following two commands will allow you to add either a new user or an existing user to correct permissions issues that you may encounter in a Linux OS.

Adding A New User To A Usergroup

Log into your Linux server via SSH / Shell.

Since we are going to be adding a new user to an existing group, you can do this by typing one command instead of first creating the user and then adding it to the usergroup. To add the new user, type the following;

"useradd -G user group"

Adding An Existing User To A Usergroup

Since the user already exists you will now need to use the "usermod" command. Any attempt to add an existing user will result in an error using the "useradd" command.

To add the user to the usergroup, type the following;

"usermod -a -G user group"

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Installing htop

htop is an interactive process viewer for Linux, which is a powerful alternative to the...

Bind Multiple IP Addresses to a Single Network Interface Card (NIC)

This tutorial demonstrates how to bind multiple IP addresses to a single NICI'll be using LAN...

Clear Memory Cache on Linux Server

By default the Linux OS has a very efficient memory management process that should be freeing any...

Set the time on a Linux server

Log into the server via SSHAt the shell prompt run the following command:date MMDDHHmmYYYYFor...

Check your disk usage in Linux

A good way to check your disk usage for folders on your Linux server is via shell.Download...