Inhaltsverzeichnis

SSH

Debian

mkdir ~/.ssh
cd ~/.ssh
wget https://raw.githubusercontent.com/JM-Lemmi/JM-Lemmi/main/authorized_keys
/etc/ssh/sshd_config
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

allow root pw login

from here.

/etc/ssh/sshd_config
PermitRootLogin yes

Pubkeyauth

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:

/etc/ssh/sshd_config
PubkeyAuthentication yes
PasswordAuthentication no

password has to be explicitely disabled

SSH-Agent

To not have to reauth ssh key all the time use ssh-agent:

eval `ssh-agent`
ssh-add ~/.ssh/id_ed25519

See also