我有一个Fedora 25 x86_64独立工作站。正在侦听端口111(通过nmap扫描标识):
$ sudo lsof -i :111
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
systemd 1 root 36u IPv4 15170 0t0 TCP *:sunrpc (LISTEN)
systemd 1 root 37u IPv4 15171 0t0 UDP *:sunrpc
systemd 1 root 38u IPv6 15172 0t0 TCP *:sunrpc (LISTEN)
systemd 1 root 39u IPv6 15173 0t0 UDP *:sunrpc
我使用以下命令禁用了端口上的Sun设备:
$ sudo systemctl disable rpcbind
$ sudo systemctl disable sunrpc
Failed to disable unit: No such file or directory
重新启动后,端口仍处于打开状态。
它似乎不是Sun Gear想要监听端口111的东西。或者也许systemd
是不尊重我禁用未使用服务的愿望。也许还有其他...
如何确定试图在端口上侦听的内容以及如何禁用它?
从下面:
$ sudo systemctl -a | grep -E "rpc|port"
var-lib-nfs-rpc_pipefs.mount loaded active mounted RPC Pipe File System
abrtd.service loaded active running ABRT Automated Bug Reporting Tool
auth-rpcgss-module.service loaded inactive dead Kernel Module supporting RPCSEC_GSS
fedora-import-state.service loaded active exited Import network configuration from initramfs
fedora-readonly.service loaded active exited Configure read-only root support
rpc-gssd.service loaded inactive dead RPC security service for NFS client and server
rpc-statd-notify.service loaded inactive dead Notify NFS peers of a restart
rpc-statd.service loaded inactive dead NFS status monitor for NFSv2/3 locking.
● rpc-svcgssd.service not-found inactive dead rpc-svcgssd.service
rpcbind.service loaded inactive dead RPC Bind
rpcbind.socket loaded active listening RPCbind Server Activation Socket
rpc_pipefs.target loaded active active rpc_pipefs.target
rpcbind.target loaded active active RPC Port Mapper