Skip to content

Instantly share code, notes, and snippets.

@jhonoryza
Created January 9, 2024 08:27
Show Gist options
  • Save jhonoryza/353705ec8e9e616f3e42d4f505051f83 to your computer and use it in GitHub Desktop.
Save jhonoryza/353705ec8e9e616f3e42d4f505051f83 to your computer and use it in GitHub Desktop.
user and group in linux

add user to a group

sudo usermod -a -G groupname username

create the group if it doesn't exist:

groupadd -g 4200 sysadmin2

Next, create the user and add it to the group:

useradd sysadmin2 -u 4201 -g 4200 -m -s /bin/bash
useradd appadmin1 -u 4100 -g 4100 -m -s /bin/bash 

and don't forget to reset password for each user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment