Created
October 18, 2016 16:37
-
-
Save slaveofcode/f352025d3ab5a1ea748cf7fa8524bafd to your computer and use it in GitHub Desktop.
Basic user operations on a Linux box
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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