telnet to a grove account then
ssh in as root to your machine. All
keystrokes on your telnet session can be
snarfed by someone (and have been). Make your first
link the most secure link!If you *ever* telnet to your machine as root from anywhere, get a hard line to the machine and then change your root password.
Services that must be removed are telnet, rexd, rsh, rlogin, rcp. Ftp *should* be removed as well. Why?
Tcpwrappers is a program that lets you decide who can get which services.
You change inetd.conf lines from something like this:
To something more like this:#service socket protocol wait? user program arguments ftp stream tcp6 nowait root /usr/sbin/ftpd ftpd telnet stream tcp6 nowait root /usr/sbin/telnetd telnetd -a
Then, rather than inet execing a process directly, it will exec the process tcpd with the appropriate argument (which is the daemon to run). If the daemon is named by a relative path, tcpd looks for the daemon in a specific location compiled into it (usually /usr/sbin).#service socket protocol wait? user program arguments ftp stream tcp6 nowait root /usr/local/tcpd ftpd telnet stream tcp6 nowait root /usr/local/tcpd telnetd -a
The special thing tcpd does is that it consults two files to determine
Before execing a daemon, tcpd determines if it's allowed to as follows:
From hosts.allow:
This means that telnetd is allowed to be connected to from any machine on the local network. The ftp daemon can be reached from any host in the domain cise.ufl.edu. An fingerd is accessible only from the machine elgin.telnetd : LOCAL ftpd : .cise.ufl.edu fingerd : elgin
From hosts.deny:
ALL : ALL
tftpd : ALL : (/usr/sbin/safe_finger -l @%h | \
/usr/bin/mail -s %d-%h root) &
The first example should be your starting point (deny all services to
anyone). On the other hand, you can deny a particular service and
even associate an action to perform if an attempt to connect to that
service is made. The tftpd example shows you you can use safe_finger
to try to determine who initiated the connection, then mail the
results to root. Using system logging is another appropriate mechanism
to report such connections.
127.0.0.1 loopback localhost 128.227.170.68 titan 128.227.170.69 timex 128.227.170.70 cartier 128.227.170.71 omega 128.227.170.72 nikewatch 128.227.170.73 olympian 128.227.170.74 starck-uhren 128.227.170.75 gshock 128.227.170.76 zenith 128.227.170.77 swatch 128.227.170.78 seagull 128.227.170.79 casio 128.227.170.80 movado 128.227.170.81 gucci 128.227.170.82 citizen 128.227.170.83 elgin elgin.unix-ippd.cise.ufl.edu
More complex (but robust) is the use of named. Frisch skirts around the issues associated with named saying, in effect, ``Buy the Book.'' The book I used was DNS and BIND by Paul Albitz and Cricket Liu. Even with the book in hand, the first time I tried to use DNS, I made some mistakes (surprise).