create user and disable password auth
This commit is contained in:
commit
0276a90ceb
2 changed files with 14 additions and 0 deletions
10
create_sudo_user.sh
Normal file
10
create_sudo_user.sh
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
# Pass an argument with the username and that will be created and added to the sudo group
|
||||
|
||||
no_argument_was_passed=false; [ -z "$1" ] && no_argument_was_passed=true
|
||||
$no_argument_was_passed && echo "No username has been passed" && return
|
||||
|
||||
USERNAME=$1
|
||||
echo "Creating user $USERNAME"
|
||||
adduser $USERNAME
|
||||
usermod -aG sudo $USERNAME
|
||||
echo "Done"
|
||||
Loading…
Add table
Add a link
Reference in a new issue