Edit the SSH configuration on your RHEL 9 Server:
This command in one fell swoop creates the file 01-hardening.conf to strengthen the security of your server!
sudo tee /etc/ssh/sshd_config.d/01-hardening.conf << 'EOF'
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 2
AllowUsers daddee
X11Forwarding no
EOF
Then, check SSH for config errors and restart the service:
sudo sshd -t
sudo systemctl restart sshd