There's no need to reload inetd, since tcpd
is invoked each time there's a connection on the telnet port. So we can
try it immediately:
# telnet box.yourdomain.com
Trying 10.0.0.1...
Connected to box.yourdomain.com.
Escape character is '^]'.
Connection closed by foreign host.
Slap! Rejected! (This is one of the few times in life that rejection
is indicative of success.) To re-enable access from our own network, we
insert the exception in /etc/hosts.allow:
in.telnetd: .yourdomain.com
At this point we're able to successfully telnet into our system again.
This is just scraping the surface of the capabilities of tcp_wrappers.
There's lots more information on tcp_wrappers in the tcpd(8) and
hosts_access(5) man pages.