Created
July 4, 2018 20:29
-
-
Save YordanGeorgiev/8f440571faef74e50897ac691127f449 to your computer and use it in GitHub Desktop.
[how-to add a linux user] how-to add a linux user #linux #user #user-management #useradd
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
# START === user management | |
#how-to add a linux group | |
export group=usr_name | |
export gid=10001 | |
sudo groupadd -g "$gid" "$group" | |
sudo cat /etc/group | grep --color "$group" | |
export user=grp_name | |
export uid=10001 | |
export home_dir=/home/$user | |
export desc="the hadoop group" | |
#how-to add an user | |
sudo useradd --uid "$uid" --home-dir "$home_dir" --gid "$group" \ | |
--create-home --shell /bin/bash "$user" \ | |
--comment "$desc" | |
sudo cat /etc/passwd | grep --color "$user" | |
groups "$user" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment