Failed to start SYSV: Knock is a port-knocking server/client.

Support for security such as Firewalls and securing linux
Post Reply
hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Failed to start SYSV: Knock is a port-knocking server/client.

Post by hack3rcon » 2019/01/23 11:44:24

Hello
I installed "knock-server" and configure it as below:

Code: Select all

[options]
UseSyslog
logfile = /var/log/knockd.log
OPTIONS="-i enp0s3"

[openSSH]
sequence = 32512,8425,27705
seq_timeout = 5
command = firewall-cmd --add-port=22/tcp
tcpflags = syn
[closeSSH]
sequence = 9136,17752,45700
seq_timeout = 5
command = firewall-cmd --remove-port=22/tcp
tcpflags = syn
But when I want to start "knockd" it show me below error:

Code: Select all

# service knockd start
Starting knockd (via systemctl):  Job for knockd.service failed because the control process exited with error code. See "systemctl status knockd.service" and "journalctl -xe" for details.
                                                           [FAILED]
And:

Code: Select all

# systemctl status knockd.service
● knockd.service - SYSV: Knock is a port-knocking server/client.
   Loaded: loaded (/etc/rc.d/init.d/knockd)
   Active: failed (Result: exit-code) since Wed 2019-01-23 06:42:31 EST; 30s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 18408 ExecStart=/etc/rc.d/init.d/knockd start (code=exited, status=1/FAILURE)

Jan 23 06:42:31 localhost.localdomain knockd[18408]: -p, --pidfile          use an alternate pidfile
Jan 23 06:42:31 localhost.localdomain knockd[18408]: -g, --logfile          use an alternate logfile
Jan 23 06:42:31 localhost.localdomain knockd[18408]: -v, --verbose          be verbose
Jan 23 06:42:31 localhost.localdomain knockd[18408]: -V, --version          display version
Jan 23 06:42:31 localhost.localdomain knockd[18408]: -h, --help             this help
Jan 23 06:42:31 localhost.localdomain knockd[18408]: [FAILED]
Jan 23 06:42:31 localhost.localdomain systemd[1]: knockd.service: control process exited, code=exited status=1
Jan 23 06:42:31 localhost.localdomain systemd[1]: Failed to start SYSV: Knock is a port-knocking server/client..
Jan 23 06:42:31 localhost.localdomain systemd[1]: Unit knockd.service entered failed state.
Jan 23 06:42:31 localhost.localdomain systemd[1]: knockd.service failed.
How can I solve it?

Thank you.

hack3rcon
Posts: 757
Joined: 2014/11/24 11:04:37

Re: Failed to start SYSV: Knock is a port-knocking server/client.

Post by hack3rcon » 2019/01/27 07:51:39

Code: Select all

# knockd -D
config: new section: 'options'
config: usesyslog
config: log file: /var/log/knockd.log
config: line 4: syntax error
usage: knockd [options]
Why line 4 has syntax error?

Post Reply