Browse Source

Merge pull request 'Added ssh-copy-id as an alternative' (#2) from cami/server-security-wiki:update/ssh into main

Reviewed-on: https://git.sp-codes.de/samuel-p/server-security-wiki/pulls/2
main
Samuel Philipp 5 months ago
parent
commit
58bd8267da
  1. 8
      secure-ssh.md

8
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 `/<your-path>/<key-name>.pub` on your client in the `/home/<user>/.ssh/authorized_keys` on your server.
Remember the path and password you choosed. Append the created public key from `/<your-path>/<key-name>.pub` on your client in the `/home/<user>/.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 /<your-path>/<key-name>.pub user@host
```
Now edit `/etc/ssh/sshd_config` on your server and set the following values:
@ -34,4 +38,4 @@ Host <your-host-or-ip>
## Apply Changes
To apply changes you made in the ssh config simply run `systemctl restart ssh.service` or `service ssh restart`.
To apply changes you made in the ssh config simply run `systemctl restart ssh.service` or `service ssh restart`.
Loading…
Cancel
Save