There is cloud-based server with Ubuntu 22.04 installed and SSH Key login setup.
After installation of Postgresql server (tried 13, 14, 15) when you try to log in to the server again it displays the message "No supported authentication methods available (server sent: publickey).
The private key is guaranteed to be correct. Interesting moment - after stopping and starting the postgresql service through serial console and password login, the virtual machine starts accepting the private key normally again.
During troubleshooting we tried installing postgresql version 13, 14, 15. It didn't work well with any of the versions.Restarting the postgresql service solves the problem with accessing the machine.The firewall is configured with SSH connections allowed from any IP address.The connection takes place at the external white IP address of the virtual machine.