sudo apt install ssh curl -y
mkdir -p ~/.ssh; curl https://github.com/gnat.keys >> ~/.ssh/authorized_keys; chmod 600 ~/.ssh/authorized_keys
sudo echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
sudo systemctl reload ssh
You can now use ssh to do a proper setup.
This is can also be done at install time in the Ubuntu Server GUI.