Rocky 9 ssh permission denied

Trying to login via ssh with password.
Changed all the needed settings, even copied the sshd_config from working CentOS7 server.
But still no login via ssh.

You should be more specific on what account you’re trying to login to and what you’re actually configuring in sshd_config.

For example, you cannot login as root with a password now. The default setting is PermitRootLogin prohibit-password.

Default on RHEL7 so also Centos7:

PermitRootLogin
Specifies whether root can log in using ssh(1). The argument must be yes, prohibit-password, without-password, forced-commands-only, or no. The default is yes.

Default on RHEL9 so also Rocky9:

PermitRootLogin
Specifies whether root can log in using ssh(1). The argument must be yes, prohibit-password, forced-commands-only, or no. The default is prohibit-password.

Thanks.
I think I misunderstood the function of the sshd_config.d directory.
I thought the file will override the settings sshd_config file.
Now I’ve copied all the settings to sshd_config and removed the Include sshd_config.d/*.conf line.

They do. There is no need to touch the /etc/ssh/sshd_config file.

What was the name of the file, what was the setting(s) and what other files are
in the /etc/ssh/sshd_config.d/ directory?


If you remove the include, then you stop using the system security policy that lists allowed ciphers.

Ok, what I’ve done now:
I removed the openssh with dnf remove openssh…
Then deleted the whole ssh directory.
Installed openssh again with dnf install openssh…
Now ssh works without any changes in the sshd_config and in the sshd_config.d directory.
Of course not for root (because not allowed by default), but for normal user.

But it was a new (my first) Rocky9.2 installation, ssh was the first thing I’ve tried on this.