For a newly deployed instance I get the following message for the first time SSH connection:
The authenticity of host '[hostname] ([IP address])' can't be established.
RSA key fingerprint is [key fingerprint].
Are you sure you want to continue connecting (yes/no)?
I want to avoid this interaction with the user.
How to safely obtain, check and save this public key?
That leaves you open to man in the middle attacks, probably not a good idea.– Eugen Konkov Sep 26 '23 at 18:34