Created
December 17, 2015 17:47
-
-
Save maestrofx/b9f7be60966cb88fbb52 to your computer and use it in GitHub Desktop.
script to add sudoers
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
#!/bin/bash | |
# Usage | |
# $ sudo chmod +x add_sudoer.sh | |
# $ ./add_sudoer.sh username | |
# | |
# add a number of users saved in txt | |
# $ ./add_sudoer.sh `cat list_of_users.txt` | |
# | |
# --> list of users to add separated by space | |
# --> echo "user1 user2 " >> list_of_users.txt | |
while [[ -n $1 ]]; do | |
sudo adduser $1 && sudo usermod -aG sudo $1; | |
shift | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment