SSH
Let me browse into /etc/ssh. When you look inside of that folder you'll see a lot of files. There's a lot of stuff in here. And the main file I care about is this guy right here
sshd_config. That's the SSH daemon's configuration. There is another one, ssh_config, that's the client. I'm not worried about the client here. I'm worried about the server, sshd_config. Now I could edit that file and start modifying things. However, there are some scenarios where when SSH gets updated, it might overwrite that file and I would lose my changes. It also makes it a little difficult if I want to merge changes to another system. So what they recommend is instead of making changes in that file, you create your own configuration file and put it under sshd_config.d.
That's a directory that's included in the main configuration
cd /etc/ssh/sshd_config.d
As you can see from the server config file
Now i will create my file inside this directory:
vim hardened.conf
sudo systemctl restart sshd
Now when i try to login:
I will add centos user now:
Using TCP wrappers with SSH
sudo vim /etc/hosts.allow
/etc/hosts.deny
Controlling SSH access with a firewall:
sudo ufw allow from 10.222.0.0/24 proto tcp to any port 22
Last updated