knockd.conf 832 B

123456789101112131415161718192021222324252627
  1. # claranet serveur
  2. # [options]
  3. # UseSyslog
  4. #
  5. # [Client]
  6. # sequence = 5019,8599,4468
  7. # seq_timeout = 5
  8. # command = /sbin/iptables -I internet_inbound 1 -s %IP% -p tcp --match multiport --dports 22,21,40000:40200 -j ACCEPT
  9. # tcpflags = syn
  10. # cmd_timeout = 86400
  11. # stop_command = /sbin/iptables -D internet_inbound -s %IP% -p tcp --match multiport --dports 22,21,40000:40200 -j ACCEPT
  12. [options]
  13. logfile = /var/log/knockd.log
  14. [SSH]
  15. sequence = 7000,8000,9000
  16. seq_timeout = 5
  17. # do not limit port 22 to the ip as it don't work with 4G connection
  18. # start_command = ufw insert 1 allow from %IP% to any port 22
  19. start_command = ufw allow ssh
  20. tcpflags = syn
  21. cmd_timeout = 600
  22. # stop_command = ufw delete allow from %IP% to any port 22
  23. stop_command = ufw delete allow ssh