Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for group

December 3, 2020

Add Existing User To A Group

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

June 16, 2020

Linux Useradd

Here’s the command to add a Linux user.

useradd -m -s $(which bash) -G sudo ulysses

useradd -m -s $(which bash) -G sudo ulysses

-m creates a home directory. -s selects a shell. -G adds user to a sudo group.

February 25, 2020

Wheel Group

Here’s an alternate way to give Linux users sudo access by adding them to the wheel group. Most Linux systems come with the wheel group already predefined. By adding users to the wheel group, they now have the ability to sudo and run root commands. The wheel group is in the sudoers file for Redhat, Centos, Debian and Ubuntu.

usermod -aG wheel username

usermod -aG wheel username

  • 1
  • 2
  • Next Page »
  • Cloud
  • Linux
  • Git

Copyright © 2012–2021