# Rocky 9 ssh permission denied

**URL:** <https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327>\
**Category:** Rocky Linux Help & Support\
**Created:** [June 16, 2023, 5:45pm UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327 "2023-06-16T17:45:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![kuchenmann](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@kuchenmann](https://forums.rockylinux.org/u/kuchenmann)\
**Post date:** [June 16, 2023, 5:45pm UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327/1 "2023-06-16T17:45:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![label](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@label](https://forums.rockylinux.org/u/label)\
**Post date:** [June 16, 2023, 5:53pm UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327/2 "2023-06-16T17:53:52Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![Cphusion](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/cphusion/32/3235_2.png) [@Cphusion](https://forums.rockylinux.org/u/Cphusion)\
**Post date:** [June 16, 2023, 6:12pm UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327/3 "2023-06-16T18:12:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kuchenmann](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@kuchenmann](https://forums.rockylinux.org/u/kuchenmann)\
**Post date:** [June 16, 2023, 7:24pm UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327/4 "2023-06-16T19:24:44Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [June 16, 2023, 7:27pm UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327/5 "2023-06-16T19:27:17Z")

</div>

> [@kuchenmann](#):
>
> I think I misunderstood the function of the sshd\_config.d directory.  
> I thought the file will override the settings sshd\_config file.

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.

---

<div class="post-metadata">

**Author:** ![kuchenmann](https://avatars.discourse-cdn.com/v4/letter/k/9fc348/32.png) [@kuchenmann](https://forums.rockylinux.org/u/kuchenmann)\
**Post date:** [June 17, 2023, 5:18am UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327/6 "2023-06-17T05:18:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brian](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/brian/32/5777_2.png) [@brian](https://forums.rockylinux.org/u/brian)\
**Post date:** [August 25, 2023, 3:00am UTC](https://forums.rockylinux.org/t/rocky-9-ssh-permission-denied/10327/7 "2023-08-25T03:00:03Z")

</div>

Closed on August 25, 2023, 3:00am UTC


