Created
February 8, 2019 14:37
-
-
Save smashnet/48873e70db97c864295f5fb398b63472 to your computer and use it in GitHub Desktop.
Revisions
-
smashnet created this gist
Feb 8, 2019 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash if [ -z "$1" ]; then echo "Please provide a name for the new user!" exit 1 fi echo "Creating user and group -$1- and adding you ($(whoami)) to that group." echo -n "Sure ye wanna do this? (y/N) -> " read answer if [ "$answer" == "y" ] || [ "$answer" == "Y" ]; then echo "Doing it so!" sudo useradd -r -s /sbin/nologin $1 sudo usermod -a -G $1 $(whoami) echo "Done!" echo $(id $1) else echo "Ok, did not do anything... bye!" fi