-
Notifications
You must be signed in to change notification settings - Fork 0
SSH security
Filip Krzyżanowski edited this page Nov 15, 2022
·
1 revision
sudo mkdir /home/fkrzski/.ssh
You need to copy your SSH key from your local computer!
Option 1: echo
- copy your SSH key and put in public_key_string
place
sudo echo public_key_string >> /home/fkrzski/.ssh/authorized_keys
Option 2: nano
- copy yous SSH key and put it into file created by nano
sudo nano /home/fkrzski/.ssh/authorized_keys
Press CTRL + SHIFT + V for paste, next CTRL + X and Y for exit with save.
It's all! Now you can log in using your key.
All things below are setting up in this file.
Fast line change in nano
: CTRL + SHIFT + -, next type line number and press ENTER.
sudo nano /etc/ssh/sshd_config
After any changes you need to restart your SSH service
sudo systemctl restart ssh
# Line 84
UsePam no
# Add this line at the bottom
PasswordAuthentication no
# Line 122
PermitRootLogin no
# Line 15
Port 123