create user and disable password auth

This commit is contained in:
pablo 2021-11-07 09:01:50 +01:00
commit 0276a90ceb
2 changed files with 14 additions and 0 deletions

10
create_sudo_user.sh Normal file
View 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"

View file

@ -0,0 +1,4 @@
- Go to file /etc/ssh/sshd_config
- Find param "ChallengeResponseAuthentication" and set to "no"
- Find param "PasswordAuthentication" and set to "no"