OpenSSH

Daemon settings

sed -z 's/PermitRootLogin yes\|$/PermitRootLogin no/' /etc/ssh/sshd_config
sed -z 's/LoginGraceTime 120\|$/LoginGraceTime 10/' /etc/ssh/sshd_config
sed -z 's/PasswordAuthentication yes\|$/PasswordAuthentication no/' /etc/ssh/sshd_config

Generate SSH key

ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519

Client config

Host *
  AddKeysToAgent yes
  IdentityFile ~/.ssh/id_ed25519
  ForwardAgent yes
  ConnectTimeout 30
  KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
  MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,umac-128@openssh.com
  Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr
  ServerAliveInterval 10
  ServerAliveCountMax 1