kazulog@sv1:~$ cat /etc/os-release | head -2 PRETTY_NAME="Ubuntu 26.04 LTS" NAME="Ubuntu" kazulog@sv1:~$ grep -vE '^(#|$)' /etc/inetd.conf daytime stream tcp6 nowait root internal kazulog@sv1:~$ ls -l /etc/inetd.d/ total 8 -rw-r--r-- 1 root root 90 Sep 12 09:47 echo -rw-r--r-- 1 root root 160 Sep 12 09:47 hello kazulog@sv1:~$ cat /etc/inetd.d/echo /etc/inetd.d/hello # echo サービス(inetd の内蔵サービス) echo stream tcp nowait root internal # 自作サービス: 10013 番につながると /usr/local/bin/hello.sh を実行する hello stream tcp nowait nobody /usr/sbin/tcpd /usr/local/bin/hello.sh kazulog@sv1:~$ cat /etc/hosts.allow # /etc/hosts.allow: list of hosts that are allowed to access the system. # See the manual pages hosts_access(5) and hosts_options(5). # # Example: ALL: LOCAL @some_netgroup # ALL: .foobar.edu EXCEPT terminalserver.foobar.edu # # If you're going to protect the portmapper use the name "rpcbind" for the # daemon name. See rpcbind(8) and rpc.mountd(8) for further information. # # SSH は必ず許可する(締め出し防止) sshd: ALL kazulog@sv1:~$ cat /etc/hosts.deny # /etc/hosts.deny: list of hosts that are _not_ allowed to access the system. # See the manual pages hosts_access(5) and hosts_options(5). # # Example: ALL: some.host.name, .some.domain # ALL EXCEPT in.fingerd: other.host.name, .other.domain # # If you're going to protect the portmapper use the name "rpcbind" for the # daemon name. See rpcbind(8) and rpc.mountd(8) for further information. # # The PARANOID wildcard matches any host whose name does not match its # address. # # You may wish to enable this to ensure any programs that don't # validate looked up hostnames still leave understandable logs. In past # versions of Debian this has been the default. # ALL: PARANOID # 自作サービスは 192.168.100.20 からの接続を拒否する hello.sh: 192.168.100.20 kazulog@sv1:~$ systemctl is-enabled inetutils-inetd; systemctl is-active inetutils-inetd enabled active kazulog@sv1:~$ systemctl is-active hello-socket.socket active kazulog@sv1:~$ sudo ss -tlnp | grep -E ":(7|13|10013|10014) " LISTEN 0 10 0.0.0.0:10013 0.0.0.0:* users:(("inetutils-inetd",pid=4189,fd=7)) LISTEN 0 10 0.0.0.0:7 0.0.0.0:* users:(("inetutils-inetd",pid=4189,fd=6)) LISTEN 0 4096 *:10014 *:* users:(("systemd",pid=1,fd=79)) LISTEN 0 10 *:13 *:* users:(("inetutils-inetd",pid=4189,fd=4))