Fail2ban error on new ISP host

Discussion in 'General' started by marceloleaes, Apr 19, 2026 at 2:47 PM.

  1. marceloleaes

    marceloleaes Member

    2026-04-19 09:40:22,245 fail2ban.utils [779]: ERROR 7f8ac9a52bf0 -- exec: nft add table inet f2b-table
    nft -- add chain inet f2b-table f2b-chain \{ type filter hook input priority -1 \; \}
    nft add set inet f2b-table addr-set-sshd \{ type ipv4_addr\; \}
    for proto in $(echo 'tcp' | sed 's/,/ /g'); do
    nft add rule inet f2b-table f2b-chain $proto dport \{ $(echo 'ssh' | sed s/:/-/g) \} ip saddr @addr-set-sshd reject
    done
    2026-04-19 09:40:22,245 fail2ban.utils [779]: ERROR 7f8ac9a52bf0 -- stderr: '/bin/sh: 1: nft: not found'
    2026-04-19 09:40:22,245 fail2ban.utils [779]: ERROR 7f8ac9a52bf0 -- stderr: '/bin/sh: 2: nft: not found'
    2026-04-19 09:40:22,245 fail2ban.utils [779]: ERROR 7f8ac9a52bf0 -- stderr: '/bin/sh: 3: nft: not found'
    2026-04-19 09:40:22,245 fail2ban.utils [779]: ERROR 7f8ac9a52bf0 -- stderr: '/bin/sh: 5: nft: not found'
    2026-04-19 09:40:22,245 fail2ban.utils [779]: ERROR 7f8ac9a52bf0 -- returned 127
    2026-04-19 09:40:22,245 fail2ban.utils [779]: INFO HINT on 127: "Command not found". Make sure that all commands in "nft add table inet f2b-table\nnft -- add chain inet f2b-table f2b-chain \\{ type filter hook input priority -1 \\; \\}\nnft add set inet f2b-table addr-set-sshd \\{ type ipv4_addr\\; \\}\nfor proto in $(echo 'tcp' | sed 's/,/ /g'); do\nnft add rule inet f2b-table f2b-chain $proto dport \\{ $(echo 'ssh' | sed s/:/-/g) \\} ip saddr @addr-set-sshd reject\ndone" are in the PATH of fail2ban-server process (grep -a PATH= /proc/`pidof -x fail2ban-server`/environ). You may want to start "fail2ban-server -f" separately, initiate it with "fail2ban-client reload" in another shell session and observe if additional informative error messages appear in the terminals.
    2026-04-19 09:40:22,245 fail2ban.actions [779]: ERROR Failed to execute ban jail 'sshd' action 'nftables' info 'ActionInfo({'ip': '45.148.10.141', 'family': 'inet4', 'fid': at 0x7f8ac8a4dd00>, 'raw-ticket': at 0x7f8ac8a4e480>})': Error starting action Jail('sshd')/nftables: 'Script error'
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    You forgot to say what operating system host is running.
    Error messages say command nft is not found. Is the package nftables installed?
    What are you doing when those error messages show up?
    What shows command
    Code:
    ls -lh /sbin/nft /usr/sbin/nft
     

Share This Page