Fedora 25 및 포트 111에서 수신 대기하는 모든 항목을 비활성화합니다.

Fedora 25 및 포트 111에서 수신 대기하는 모든 항목을 비활성화합니다.

저는 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

다음을 사용하여 포트의 선 기어를 비활성화했습니다.

$ 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

답변1

계속 실행하면 다음과 같은 경고가 표시되는 것 같습니다 sudo systemctl disable rpcbind.Fedora 25

Warning: Stopping rpcbind.service, but it can still be activated by:
rpcbind.socket

따라서 다음을 시도해 볼 수 있습니다.

sudo systemctl stop rpcbind.socket
sudo systemctl disable rpcbind.socket

답변2

이것은 소켓 활성화입니다 :). 당신의 의심은 정확합니다.

비활성화해야 합니다 rpcbind.socket. 비활성화하는 rpcbind.service것은 systemctl disable rpcbind가상입니다. 아무런 효과가 없습니다.

또한 disable이는 시작 시 발생하는 작업에만 영향을 미칩니다. 따라서 즉각적인 변화를 확인하고 싶다면반품달리고 싶다 systemctl stop rpcbind.socket.

편집하다:이 문제나와 매우 비슷해 보입니다. Jeff Schaller는 이 명령을 사용하여 어떤 systemctl list-sockets포트와 서비스가 소켓 활성화를 수행하고 있는지 확인할 수 있다고 지적합니다.systemd


나는 다시 가서 살펴보았다 Fedora-Workstation-Live-x86_64-25-1.3.iso.

rpcbind.service의 상태가 표시됩니다 indirect; vendor preset; disabled. (반품 Active: inactive (dead)). 따라서 다시 비활성화(또는 중지)해도 아무런 변화가 없습니다.

indirect나는 여기에 이 ​​유닛을 활성화하는 다른 유닛(소켓 유닛을 포함하되 이에 국한되지 않음)에 대해 알아야 할 힌트가 있다고 생각합니다 . 소켓 장치도 중지되면 indirect에서 변경됩니다 disabled.

이상한 점은소켓단위는 로 표시됩니다 enabled; vendor preset: disabled. 이는 rpcbind.socket이 Fedora 25 이미지에서 활성화되어 있지만 /lib/systemd/system-preset/80-workstation.preset활성화되지 않을 수 있음을 의미합니다 90-default.preset. 이는 (현재) 정책에 위배되는 것으로 보입니다.https://fedoraproject.org/wiki/Packaging:DefaultServices90-default.preset에 대한 링크 -

서비스를 기본적으로 활성화해야 하는 경우 배포 사전 설정 파일 중 하나에 추가해야 합니다.

이 문제는 어느 시점에서 해결되었습니다. rpcbind.socket더 이상 활성화되지 않습니다 Fedora-Workstation-Live-x86_64-28-1.1.iso.

(이것은 Fedora 25 디스크에서 설치된 시스템의 네트워크에서 rpcbind/port 111이 자동으로 액세스 가능하다는 의미는 아닙니다. 설치에는 다음도 포함됩니다.방화벽포트 111은 허용되지 않음)

답변3

포트 111은 다음으로 연결됩니다.포트 매핑. NFS를 사용하는 경우 이것이 필요할 가능성이 높습니다. 해당 서비스의 이름을 확인하고 비활성화하는 데 사용할 수 있습니다 systemctl -a | grep -E "rpc|port"(당시에는 Fedora 상자에 액세스할 수 없었습니다).

답변4

nfs이 포트는 패키지에서 설치된 서비스에 의해 활성화됩니다 nfs-utils. 필요하지 않다면 제거하는 것이 가장 좋습니다. nfs-utils일반적으로 iscsi-initiator-utils패키지의 종속성으로 설치됩니다 libvirt. 두 패키지 모두 필요하지 않은 다수의 서비스와 소켓을 활성화합니다. 이 명령을 사용하여 비활성화 nfs하고 iscsi-initiator-utils서비스할 수 있습니다.

systemctl disable nfs-client.target
systemctl stop nfs-client.target
systemctl disable rpcbind.socket
systemctl stop rpcbind.socket
systemctl stop rpc_pipefs.target
systemctl stop rpcbind.target
systemctl stop rpcbind.service
systemctl disable rpcbind.service
systemctl stop var-lib-nfs-rpc_pipefs.mount
systemctl stop proc-fs-nfsd.mount 
systemctl disable gssproxy.service
systemctl stop gssproxy.service
modprobe -r sunrpc
systemctl disable iscsid.socket
systemctl stop iscsid.socket
systemctl disable iscsiuio.socket
systemctl stop iscsiuio.socket
systemctl disable iscsid.service
systemctl stop iscsid.service
systemctl disable iscsiuio.service
systemctl stop iscsiuio.service

관련 정보