Site update

This commit is contained in:
CronyAkatsuki 2024-04-04 21:35:06 +02:00
parent 0b4d2c5ac2
commit 8b550c4f94
4 changed files with 18 additions and 18 deletions

View file

@ -1,5 +1,5 @@
+++
title = 'Securing Ssh'
title = 'Securing SSH'
date = 2024-04-04T20:44:10+02:00
draft = false
+++
@ -17,11 +17,11 @@ One of the main practice to secure ssh is by using public/private ssh key pair a
First you need to generate a key pair by running the commmand `ssh-keygen`.
After generating the key and the command `ssh-copy-id ~/.ssh/key_name user@host` to copy the key to the server.
After generating the key run the command `ssh-copy-id ~/.ssh/key_name user@host` to copy the key to the server.
Connection to the server now it will ask you for the ssh key password if you set one, if you didn't then it will just directly connect it.
Connecting to the server now it will ask you for the ssh key password if you set one, if you didn't then it will just directly connect it.
While you are connected to the server now, I would recommend you to change next settings to the values I recommend to make sure you can only connect to the server with ssh key pairs already on the server. Make sure to uncommmend the values in your config, and change like I did in my examples.
While you are connected to the server now, I would change next settings to the values I recommend to make sure you can only connect to the server with ssh key pairs already on the server. Make sure to uncomment the values in your config, and change like I did in my examples.
> /etc/ssh/sshd_config
```conf
@ -57,7 +57,7 @@ Next best way to secure ssh is to only allow connection from specific ip, prefer
Main way I do it is using wireguard. I set it up using the landchad [guide](https://landchad.net/wireguard).
Then in your sshd config you can make it so that ssh will only accept connection to the user with only the current using syntax.
Then in your sshd config you can make it so that ssh will only accept connection to the user with only the specific up using this syntax.
```conf
AllowUsers new-user@172.16.0.2