AlmaLinux 9 - Error connect ssh

I’m trying to connect from another server, with PHP over ssh with ssh2_connect.
When I try to connect to the AlmaLinux 9 server, it tells me: Unable to negotiate with port 49820: no matching host key type found. Their offer: ssh-rsa,ssh-dss

I already tried to add the commands
PubkeyAcceptedAlgorithms +ssh-rsa
HostkeyAlgorithms +ssh-rsa

In the SSH configuration files, however, to no avail.
Does anyone know what this error could be and how to fix it?

Hi, try change rsa options to legacy connections,