From 7799de5738aab06aa19d38ba3486b22f0df09a6f Mon Sep 17 00:00:00 2001 From: Samuel Philipp Date: Sat, 20 Feb 2021 13:11:39 +0000 Subject: [PATCH] Update 'secure-ssh.md' --- secure-ssh.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/secure-ssh.md b/secure-ssh.md index 80087e8..a2d4f9a 100644 --- a/secure-ssh.md +++ b/secure-ssh.md @@ -12,15 +12,7 @@ Create a new key pair on your client: ssh-keygen -b 4096 ``` -Remember the path and password you choosed. Append the created public key from `//.pub` on your client in the `/home//.ssh/authorized_keys`. - -If you changed the path you can add the following to your `~/.ssh/config` file on your client: - -``` -Host - User # optional - IdentityFile // -``` +Remember the path and password you choosed. Append the created public key from `//.pub` on your client in the `/home//.ssh/authorized_keys` on your server. Now edit `/etc/ssh/sshd_config` on your server and set the following values: @@ -30,3 +22,15 @@ AuthorizedKeysFile .ssh/authorized_keys PasswordAuthentication no ``` + +If you changed the path you can add the following to your `~/.ssh/config` file on your client: + +``` +Host + User # optional + IdentityFile // +``` + +## Apply Changes + +To apply changes you made in the ssh config simply run `systemctl restart ssh.service` or `service ssh restart`. \ No newline at end of file