Centos8 SSH Configuration not picked up
Hi,
I am trying to set up SSH on a fresh Centos 8 VM.
First I create a user and add to the wheel group since I don't want to operate with root.
adduser username && passwd username
usermod -aG wheel username
su username
Then I create a file /etc/ssh/ssh_config.d/custom.conf
LoginGraceTime 1m
PermitRootLogin no
PubkeyAuthentication yes
PasswordAuthentication no
PermitEmptyPasswords no
IgnoreRhosts yes
Protocol 2
AllowUsers username
I restart sshd with sudo systemctl restart sshd
and even shut the server down and rebooted.
However, I still can login with password from root and username. What am I missing?
2 Replies
I don't have any experience with CentOS, and Ubuntu doesn't have the ssh_config.d directory, so this is just a guess.
SSH has 2 config files - one server sshd_config
and one client ssh_config
.
Your file is in /etc/ssh/ssh_config.d
- is there a /etc/ssh/sshd_config.d
directory (note the extra "d" in the directory name - sshd
)?