1

I have been seeing a lot of brute force attempts on a fedora box. How do I use firewalld to block all ssh traffic outside of a given range? I'm looking for something like the iptables:

iptables -A INPUT -p tcp --destination-port 22 -m iprange --src-range 192.168.1.100-192.168.1.200 -j ACCEPT  
satori7
  • 157
  • 1
  • 3
  • 11

2 Answers2

2

Also just as an alternative to Iptables. You can control the ssh access as followed

Edit your /etc/ssh/sshd_config

AllowUsers admin@192.169.1.100 admin@192.168.1.200 testadmin

--OR--

AllowUsers *@192.168.1.100 *@192.168.1.200

Restart sshd services.

Chakri
  • 1,070
  • 6
  • 8
1

You should be able to do this via the rich language interface of firewalld :

firewall-cmd --add-rich-rule='rule family="ipv4" source address="192.168.1.100/25" service name="ssh" reject'

This is just written by what I found and had in memory, not tested. But it might be a starting point for you to play.

liquidat
  • 510
  • 4
  • 3