mkdir ~/.ssh cd ~/.ssh wget https://raw.githubusercontent.com/JM-Lemmi/JM-Lemmi/main/authorized_keys
Port 22 #Port 22222 PermitRootLogin Prohibit-Password PasswordAuthentication no ChallengeResponseAuthentication no #Match Address 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 # PasswordAuthentication yes
echo "PermitRootLogin Prohibit-Password" >> /etc/ssh/sshd_config
from here.
PermitRootLogin yes
from https://linuxhandbook.com/add-ssh-public-key-to-server/
add key to root/.ssh/authorized_keys
oder /home/user/.ssh/authorized_keys
Settings for only Pubkey auth:
PubkeyAuthentication yes PasswordAuthentication no
password has to be explicitely disabled
To not have to reauth ssh key all the time use ssh-agent:
eval `ssh-agent` ssh-add ~/.ssh/id_ed25519