2

How can i block all ssh connections except ones from 192.168.1.1 in firewalld and at the same time log the the refused ssh connections?

I tried:

firewall-cmd --permanent --set-default-zone=drop
firewall-cmd --permanent --add-source=192.168.1.1 --zone=trusted
firewall-cmd --permanent --add-service=ssh --zone=trusted

this blocks them but doesn't log the denied ssh connections.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Khashi A
  • 21
  • 2

1 Answers1

0

You have to enable the logging of denied packets in /etc/firewalld/firewalld.conf

LogDenied=all

or on the command line:

firewall-cmd --set-log-denied=all
kofemann
  • 4,217
  • 1
  • 34
  • 39