← 返回命令列表

Linux command

knockd 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

knockd -d

Example

knockd -c [path/to/knockd.conf]

说明

knockd is the server component of port knocking. It listens for specific sequences of connection attempts and executes commands when a valid sequence is detected. Configuration in /etc/knockd.conf defines sequences and corresponding commands. Typical use cases include opening firewall ports for SSH access after receiving the correct knock sequence. Example configuration opens SSH: ``` openSSH sequence = 7000,8000,9000 command = /sbin/iptables -A INPUT -s %IP% -p tcp --dport 22 -j ACCEPT ```

参数

-d, --daemon
Run as a daemon in the background
-c, --config _FILE_
Use specified configuration file
-i, --interface _IF_
Network interface to listen on
-D, --debug
Output debug messages
-l, --lookup
Lookup DNS names for log entries

FAQ

What is the knockd command used for?

knockd is the server component of port knocking. It listens for specific sequences of connection attempts and executes commands when a valid sequence is detected. Configuration in /etc/knockd.conf defines sequences and corresponding commands. Typical use cases include opening firewall ports for SSH access after receiving the correct knock sequence. Example configuration opens SSH: ``` openSSH sequence = 7000,8000,9000 command = /sbin/iptables -A INPUT -s %IP% -p tcp --dport 22 -j ACCEPT ```

How do I run a basic knockd example?

Run `knockd -d` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -d, --daemon do in knockd?

Run as a daemon in the background