Disclaimer

This is not intended to be a tutorial on basic Unix/network security. It is only here to point out some additional security measures that you may want to take to avoid compromises to your account/machine.

Avoiding sniffed passwords

This is probably the most common method of compromising Unix accounts at Stanford (in Oct. 1998, a packet sniffer installed on a machine in Sweet Hall gathered over 5000 username/password combinations in a two week period). Like it or not, the machines are attached directly to the internet (not hidden behind a firewall), and machines do periodically get broken into. Often the hacker sets up a packer sniffer, a program which will gather and filter all traffic over the local network looking for username/password combinations. There is virtually nothing that can you do to avoid the machine compromise (unless you are the system administrator for all machines on your local net), but you can take precautions to minimize the probability that your account will be sniffed by avoiding sending your username/password over the network.

SSH

If you don't have a SUNet ID, your only option is to use SSH. SSH also has a companion remote copy program, scp, that can be used as a replacement for rcp or ftp. SSH is quickly becoming my top choice because of the tunneling capabilities (i.e. the ability to route almost any network connection through an encrypted [and even compressed!] link).

If you are looking for a Window-based ssh client, try putty. Stanford's Secure Desktop Computing site also has pointers to other clients.

Besides sending an encrypted password over the network, most ssh clients automatically tunnel X connections over an encrypted link which makes it safer and more convenient to use xauth-style access. It is also possible to use port tunneling in via ssh to avoid passwords being sniffed via ftp or POP. See the instructions on configuring additional ports to be tunneled. SSH also supports compression, which can be useful to get better throughput over slow (dialup) links, though nothing in the world can improve latency.

The machines in the gloworm cluster also support RSA authentication (though it doesn't get you a Kerberos ticket-granting-ticket or an AFS token). If you want to use RSA authentication, you need to generate a private and public key pair for your client-side identity.

    ssh-keygen -b 1024 -f $HOME/.ssh/identity
      (enter your passphrase)
Needless to say, your passphrase should be something that is difficult to guess. You can (securely) transport ("securely" means over an encrypted link, not via ftp) this private identity file to other (unix) client machines from which you will be using RSA authentication. Make sure that only you can read this identity file.

Then, append the contents of $HOME/.ssh/identity.pub (the public key) to $HOME/.ssh/authorized_keys on all machines that you indend to use RSA authentication to log into. Permissions are important for this file; it should be world-readable, but writable only by the owner (not group writable). Because all machines in the gloworm cluster share a common file space, you only need to add your public key once.

If you use console logins on your workstation, you may also want to append the following to your ~/.login file

    if ( ${?SSH_CLIENT} == 0 ) then
      eval `ssh-agent`
      ssh-add
    endif
You should also kill off the agent at the termination of your login session, so you may want to add something similar to
  if ( ${?SSH_AGENT_PID} ) then
    eval `ssh-agent -k`
  endif
to your ~/.logout file. Be careful with this, because if you log in remotely from other machines, you may kill the agent prematurely. A better fragment for your ~/.logout is
set howmanyofme=`who | cut -d" " -f 1 | grep $USER | wc -l`
if ( $howmanyofme == 1 ) then
  if ( ${?SSH_AGENT_PID} ) then
    eval `ssh-agent -k`
  endif
endif
If you use CDE, to be prompted for your RSA passphrase on login to CDE, add something similar to the following to your ~/.dtprofile:
eval `/usr/pubsw/bin/ssh-agent -s`
/usr/openwin/bin/xterm -font 9x15 -geometry 80x40+250+100 \
  -bg blue -fg white -e /usr/pubsw/bin/ssh-add
You should also kill off the agent at the termination of the CDE session. To do this, create ~/.dt/sessions/sessionexit (with execute permissions) and the following contents:
#!/bin/sh
/usr/pubsw/bin/ssh-agent -k
If you don't use console logins or CDE, then you will need to figure out how to start the ssh-agent and provide the RSA passphrase on login.

Kerberos

If you have a SUNet ID, you also have the option to use Kerberos.

Avoiding guessed passwords

The goal here to to pick an easily remembered, but uncrackable password. There are hackers out there that try to `crack' accounts by comparing encrypted passwords against the results of encrypting simple variations on words in dictionaries. See the article "Picking an unguessable password" for some guidelines.

Account compromises by cracking passwords are becoming less common (especially on systems where the encrypted passwords are stored in a shadow file, instead of being readable to everyone on the system). Although shadow passwords are the norm on Solaris, certain features of our cluster prevent them from being implemented for our network password database.

Avoiding compromises due to file permissions

Avoiding compromises due to trojan horse attacks

Avoiding compromises via the X window system

The answer is simple, never use "xhost"-based authentication. Use xauth, instead.

With CDE, or the PUBSW "x" or "openwin" scripts, this should already be set up, provided you stay within the cluster. If you run X applications on machines not in the cluster, you will need to transfer your key ("xauth list" on the local machine to find the key, then "xauth add" on the remote machine to transfer the key).

For those using X software on a Mac or PC, xauth-style access is often tricky to set up, but it is usually possible. Check the documentation that came with your X emulation software.

Also see Securing X Windows.


action@gloworm.stanford.edu
Last modified: Tue May 20 11:45:41 PDT 2004