SSH configuration

generate ssh with command

ssh-keygen

copy ssh public key to vps
cat ~/.ssh/id_rsa.pub | ssh <user>@<ip> -p 22 "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

set PasswordAuthentication no
in
/etc/ssh/sshd_config

after the changes restart the service

Source:
https://www.digitalocean.com/community/tutorials/how-to-configure-ssh-key-based-authentication-on-a-linux-server https://ostechnix.com/how-to-enable-ssh-on-freebsd/

https://computingforgeeks.com/how-to-install-freebsd-on-hetzner-root-server/

https://graspingtech.com/freebsd-fix-su-sorry-message/