diff --git a/custom-cmds-in-ubuntu/bin_examples/autouser b/custom-cmds-in-ubuntu/bin_examples/autouser new file mode 100644 index 0000000..23d0136 --- /dev/null +++ b/custom-cmds-in-ubuntu/bin_examples/autouser @@ -0,0 +1,22 @@ +#!/bin/bash +# ___ _ _ _ __ +# / __|| |_ | |_ ___ | '_ \ ___ +# \__ \| _|| \ / _ \| .__// -_) +# |___/ \__||_||_|\___/|_| \___| + +## nano ~/.bashrc +## and add this to the end of the file: export PATH=$PATH:~/bin +## sudo chmod +x ~/bin/*;su -l $USER + +### USAGE: + +U=$1 +P=$2 +R=$4 + +if [ "$3" = "sudo" ] +then + echo $4 | sudo -S adduser $U --gecos "69,69,69,69" --disabled-password;echo "$U:$P" | sudo chpasswd;usermod -aG sudo $U +else + adduser $U --gecos "69,69,69,69" --disabled-password;echo "$U:$P" | chpasswd;usermod -aG sudo $U +fi \ No newline at end of file