/usr/libexec/sshg-fw: line 57: read error: 0: Success

Issue #64 duplicate
Former user created an issue

Hello,

when I run sshguard -w <IP> as root I get the above error.

Please help. :-)

Comments (10)

  1. Addi Abel

    Arch Linux with ZFS Linux server.name 4.9.8-1-ARCH #1 SMP PREEMPT Mon Feb 6 12:59:40 CET 2017 x86_64 GNU/Linux

    Name : sshguard Version : 1.7.1-1 Description : Brute force detector for SSH, Exim, VSFTPD and more. Blocks by ip with iptables Architecture : x86_64 URL : http://www.sshguard.net/ Licenses : GPL Groups : None Provides : None Depends On : iptables Optional Deps : None Required By : None Optional For : None Conflicts With : None Replaces : None Installed Size : 2.36 MiB Packager : Sergej Pupykin pupykin.s+arch@gmail.com Build Date : Fri Nov 11 10:26:26 2016 Install Date : Tue Dec 13 19:33:25 2016 Install Reason : Explicitly installed Install Script : Yes Validated By : Signature

    executing: sudo sshguard -w 138.n.n.n which then hangs forever ... then CTRL+C

    returns: /usr/libexec/sshg-fw: line 57: read error: 0: Success

    excecuting /usr/libexec/sshg-fw -w 138.n.n.n has the same result.

    checking in the script sshf-fw, it hasn't got a whitlisting function - I haven't downloaded the source code to check further.

  2. Kevin Zheng

    What's the full command-line you're using to execute SSHGuard, starting with sudo sshguard -w 138.n.n.n?

    If you don't give it a log file to read, it'll be expecting logs to come in over standard input.

  3. Addi Abel

    ● sshguard.service - Block hacking attempts Loaded: loaded (/usr/lib/systemd/system/sshguard.service; enabled; vendor preset: disabled) Active: active (running) since Wed 2017-03-01 11:22:19 GMT; 3 days ago Main PID: 1002 (sshguard-journa) Tasks: 5 (limit: 4915) CGroup: /system.slice/sshguard.service ├─1002 /bin/sh /usr/lib/systemd/scripts/sshguard-journalctl -p 21600 -a 12 -b 12:/var/db/sshguard/blacklist.db SYSLOG_FACILITY=4 SYSLOG_FACILITY=10 ├─1006 /usr/bin/journalctl -afb -p info -n1 -o cat SYSLOG_FACILITY=4 SYSLOG_FACILITY=10 ├─1007 /usr/bin/sshguard -p 21600 -a 12 -b 12:/var/db/sshguard/blacklist.db └─1012 /bin/sh /usr/libexec/sshg-fw

  4. Kevin Zheng
    • changed status to open

    This looks like issue #56 and was fixed in ba09cf4. Does this error only occur when exiting SSHGuard? Does adding exit to your sshg-fw script fix the issue?

  5. Addi Abel

    I checked ba09cf4 ...

    the part in the version 1.7.1 looks like this:

    fw_fin() { : }

    fw_init if [ $? -ne 0 ]; then echo "Could not initialize firewall" >&2 exit 1 fi

    cleanup() { trap "" EXIT fw_fin }

  6. Kevin Zheng

    It's missing a call to "exit" in cleanup(). If you add "exit" to the last line before the end of cleanup() does the issue go away?

  7. Log in to comment