SSH
creating a ssh key
ssh-keygen -t rsa -C "my server"
set a path where it should save

confirm 2 times with enter so no password is set

the key is now generated

connect to your server using your normal password
ssh root@myip
create the .ssh folder
mkdir ~/.ssh

open ~/.ssh/authorized_keys using nano
nano ~/.ssh/authorized_keys

copy your public key from the .pub file (in this example my-server.pub) and paste it into the ssh session

close nano by pressing ctrl + X

confirm with Y

confirm with Enter
open the sshd (ssh deamon) config file using nano
nano /etc/ssh/sshd_config

enabling using ssh key by removing the # Infront of PubkeyAuthentication yes
before:
#PubkeyAuthentication yes
after:
PubkeyAuthentication yes
disabling the password usage by replacing yes with no in at PasswordAuthentication
before:
PasswordAuthentication yes
after:
PasswordAuthentication no
close nano once again using CTRL + X, confirming with Y, and then confirming with enter
restart sshd
service sshd restart

exit the ssh session
exit

connect again using the ssh key
ssh root@myip -i my-server
