Created
October 10, 2018 12:25
-
-
Save EJSohn/7461d750426b360e57fdcc881d9d9e22 to your computer and use it in GitHub Desktop.
bash script that add user in ubuntu
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
| echo "Need root permission." | |
| sudo echo "Done." | |
| read -p "1. Enter username: " username | |
| read -p "2. Enter comment: " comment | |
| sudo adduser $username -c "$comment" --firstuid 10000 --ingroup developers --disabled-password --gecos "" | |
| echo "User created!" | |
| echo -e "$username\n$username" | sudo passwd $username >/dev/null 2>&1 | |
| sudo passwd -e $username >/dev/null 2>&1 | |
| echo "username : $username" | |
| echo "initial password : $username" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment