Created
April 24, 2016 07:47
-
-
Save jbalzar/be29b2e7524d7811e72163c577717ef4 to your computer and use it in GitHub Desktop.
User Management on Linux server
This file contains 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 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