Skip to content

Instantly share code, notes, and snippets.

@jbalzar
Created April 24, 2016 07:47
Show Gist options
  • Save jbalzar/be29b2e7524d7811e72163c577717ef4 to your computer and use it in GitHub Desktop.
Save jbalzar/be29b2e7524d7811e72163c577717ef4 to your computer and use it in GitHub Desktop.
User Management on Linux server
# Add new user
sudo useradd newuser
# Set password for newuser user
sudo passwd newuser
# Delete newuser user
sudo userdel newuser
# Create a group
sudo groupadd newgroup
# Add newuser user to newgroup group
# -a : append
# -G : group that wants to specify of | multiple/single group
# -g : default group
sudo usermod -a -G newgroup newuser
# Multiple adding groups to user
# groups: newgroup1 and newgroup2
sudo usermod -G newgroup1,newgroup2 newuser
# Check newuser user group
sudo groups newuser
# Delete newgroup group
sudo groupdel newgroup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment