Last active
September 7, 2017 21:57
-
-
Save igolden/3dcd87ad9c08883e3726a4fe8dc8de22 to your computer and use it in GitHub Desktop.
Adds a new user
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
#!/bin/bash | |
set -e | |
echo "This tool will create a new sudo user." | |
echo "================================================" | |
echo "" | |
echo "Choose username:" | |
read NEWUSER | |
echo "Choose password:" | |
read PASSWORD | |
echo "Creating user, setting 'defaultpass', adding to sudoers" | |
useradd $NEWUSER | |
echo $NEWUSER:$PASSWORD | /usr/sbin/chpasswd | |
echo "$NEWUSER ALL=(ALL:ALL) ALL" >> /etc/sudoers |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment