From 76985ca774618d94bcfca3bb803fa704b75c86e5 Mon Sep 17 00:00:00 2001 From: Asocia Date: Fri, 14 May 2021 17:26:43 +0300 Subject: [PATCH] TIL: Disabling password login --- ssh/disabling_password_login.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ssh/disabling_password_login.md diff --git a/ssh/disabling_password_login.md b/ssh/disabling_password_login.md new file mode 100644 index 0000000..68340b7 --- /dev/null +++ b/ssh/disabling_password_login.md @@ -0,0 +1,15 @@ +You can disable password login by editing `/etc/ssh/sshd_config` like this: +``` +File: /etc/ssh/sshd_config +... +ChallengeResponseAuthentication no +PasswordAuthentication no +UsePAM no +``` + + +Before running the following command, **make sure** you have configured ssh keys properly and can login with them. Otherwise you won't be able to login remotely. +``` +# you may need to run a different command based on your system +sudo systemctl restart ssh.service +```