CSE Unix Security Awareness
Short security checklist:
- Choose a good password.
- Protect your password and do not share it with anyone.
- Be aware of the permissions on your files and directories and what those permissions mean in terms of access for other users.
- Never run a program that is in another user's directory or in /tmp or any other public space.
- Report suspicious behavior or incidents to the system managers.
- Use the self_check script regularly.
Unix system security is largely the responsibility of the system administrators. In managing our systems, we choose a middle ground between having so little security that any user can harm the system and having so much security that academic curiosity and the free interchange of knowledge is stifled. There is essentially a default level of security that you can accept, increase, or decrease according to your needs.
The default level of security is sufficient to protect your work from careless mistakes and naive attempts at tampering. However, for your own work to be reasonably secure, you must understand something about the Unix access mechanisms and what your responsibilities are in maintaining security.
This document is not intended to be a security tutorial. All the commands and methods discussed are standard parts of Sun Solaris unless otherwise indicated. For additional information, please see the manual pages and other Unix documentation.
The examples and command syntax shown are for the Solaris (System V) flavor Unix. The few SunOS (BSD derived) systems we still operate are somewhat different. The HP-UX systems in the Case Center also use the System V flavor of Unix and have similar commands and capabilities, but the syntax may differ slightly. The various versions of Unix are slowly converging on a standard set of commands.
Account Security
A good password is composed of two or more small nonsense words and two or more non-alphabetic symbols or uppercase letters. For example: dog$waLL, 8bar3goo, I2pIne4u. Such passwords are easy to remember, yet are very difficult for people (or programs) to guess. You may enter a password of any length, but only the first eight characters are used.
File Access
The .rhosts file
+@cse lees ozma.emerald.city.oz lees
Data Encryption
Outside of vi you can use the crypt command to encrypt or decrypt a file. First use gzip to compress the file, then use crypt. See the man pages for more information.
Of course you must decrypt a file to use it. This makes the file at least temporarily vulnerable. You can shorten this vulnerability by using crypt in a pipe:
gzip [file] | crypt [key] | lpr -Psomeprinter
WARNING: If you encrypt a file and forget the encryption key, you are out of luck. There is no way we can help you recover your file!
File Backups
Common Sense
Ooops
set noclobber alias cp 'cp -i' alias mv 'mv -i' alias rm 'rm -i'
The -i option causes the command to ask for confirmation before a file is written over or removed. The noclobber switch prevents you from redirecting output to an existing file unless you permit it by using >! syntax. If you use other than the C shell, please set up your dot files to provide similar protection.
Trojan horses
For the same reason you should not have "." (the current directory in your path). Consider what happens if a nasty person plants executable files in /tmp having names like "ls" and "cd". Even if "." is last in your path, you can be caught by trojan horses having names like "sl", "csl", and so on.
Another favorite trick is to write a program that makes the monitor look like the standard login screen. When you try to login the program captures your username and password and then dies, making it look like you typed your password incorrectly. In practice this is very difficult to do in such a way that the bogus login screen looks and feels completely correct.
The message here is pay attention and do not take for granted the security of your computing environment.