What do you have set for allowusers and allowgroups? Enable verbose logging and examine the logs for errors.
OpenSSH Server and Authentication agent enabled successfully, but authentication fails when trying to connect
I am using Windows Server 2019 Datacenter. I successfully enabled OpenSSH Server and OpenSSH client from Apps & Features and set both OpenSSH Server and Authentication Agent in services.msc as Automatic Startup and checked if both are running. Even as confirmation, port 22 was open as it runs and was closed as it was stopped. All firewall exceptions were OK. But when I tried to authenticate into it using my mac's terminal, it always said: user ID or password invalid. Even though I knew 100% that both of them are correct. Even RDP was working with the same but ssh refused connection. Sometimes, it gave a weird message in my mac's terminal "ssh listen sock" or something like that. And yes, I also tried removing # from PasswordAuthentication=yes and saved it but nothing happened. Please help me in resolving the issue.