Add 'custom-cmds-in-ubuntu/bin_examples/autouser'
This commit is contained in:
parent
6acbc825b6
commit
718c25bf3c
22
custom-cmds-in-ubuntu/bin_examples/autouser
Normal file
22
custom-cmds-in-ubuntu/bin_examples/autouser
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user