From 0276a90ceb976291f157803835dfc690b7d3410f Mon Sep 17 00:00:00 2001 From: pablo Date: Sun, 7 Nov 2021 09:01:50 +0100 Subject: [PATCH] create user and disable password auth --- create_sudo_user.sh | 10 ++++++++++ how_to_disabe_ssh_pwd_auth.txt | 4 ++++ 2 files changed, 14 insertions(+) create mode 100644 create_sudo_user.sh create mode 100644 how_to_disabe_ssh_pwd_auth.txt diff --git a/create_sudo_user.sh b/create_sudo_user.sh new file mode 100644 index 0000000..33cd9b1 --- /dev/null +++ b/create_sudo_user.sh @@ -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" diff --git a/how_to_disabe_ssh_pwd_auth.txt b/how_to_disabe_ssh_pwd_auth.txt new file mode 100644 index 0000000..7aa53e1 --- /dev/null +++ b/how_to_disabe_ssh_pwd_auth.txt @@ -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" +