Skip to content

Instantly share code, notes, and snippets.

@slaveofcode
Created October 18, 2016 16:37
Show Gist options
  • Save slaveofcode/f352025d3ab5a1ea748cf7fa8524bafd to your computer and use it in GitHub Desktop.
Save slaveofcode/f352025d3ab5a1ea748cf7fa8524bafd to your computer and use it in GitHub Desktop.
Basic user operations on a Linux box
# add user to linux and create home directory (remember to change SHELL in /etc/passwd)
useradd -m USER
# set password
passwd USER
# add to extra groups, no change on primary
usermod -a -G GROUP1,GROUP2 USER
# list groups a user belongs to
groups USER1 USER2
# delete user and home directory
userdel -r USER
# create a group
groupadd GROUP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment