From ca74cbe854714742959f7114f344798b70331c4f Mon Sep 17 00:00:00 2001 From: cami Date: Sat, 20 Feb 2021 22:33:07 +0100 Subject: [PATCH] Added ssh-copy-id as an alternative ssh-copy-id can be used to copy keys from the local client to the remote server --- secure-ssh.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/secure-ssh.md b/secure-ssh.md index 260234e..c3df427 100644 --- a/secure-ssh.md +++ b/secure-ssh.md @@ -12,7 +12,11 @@ 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` on your server. +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. Alternatively you can use the command `ssh-copy-id` on your local client. For this command you can do the following: + +```bash +ssh-copy-id -i //.pub user@host +``` Now edit `/etc/ssh/sshd_config` on your server and set the following values: @@ -34,4 +38,4 @@ Host ## 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 +To apply changes you made in the ssh config simply run `systemctl restart ssh.service` or `service ssh restart`. -- 2.45.2