Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Administering a System: Managing System Security
Managing Access to Files and Directories
Chapter 8772
Protecting User Accounts
These guidelines should be followed to protect user accounts:
• Except for the owners, home directories should not be writable
because it allows any user to add and remove files from them.
• Users’ .profile, .kshrc, .login, and .cshrc files should not be
writable by anyone other than the account owner.
• A user’s .rhosts file should not be readable or writable by anybody
other than the owner. This precaution prevents users from guessing
what other accounts you have, as well as preventing anyone from
editing your .rhosts file to gain access to those systems. See
hosts.equiv (4).
• Use of a .netrc file is discouraged, since it bypasses login
authentication for remote login and even contains the user’s
unencrypted password. If used, .netrc must not be readable or
writable by anyone other than its owner. See netrc (4).
• Some systems maintain an /etc/securetty file, which should not be
writable. See login (1).
Security Considerations for Device Files
Access to all devices in your system is controlled by device special files,
which enable programs to be device independent. These files have been
shipped with permission settings that enable proper use and maximal
security.
If you install any other special files, refer to insf (1M) for the correct
permission settings.
Since device special files can be as vulnerable to tampering as any other
file, observe the following precautions:
• All device files should be kept in /dev.
• Protect the memory files, /dev/mem and /dev/kmem, from casual
access, since these files contain sensitive user information. For
example, a program that watches memory for an invocation of the
login program might copy the password from login’s buffers when a
user types it in. The directory entries should look like:
crw-r----- 1 bin sys 3 0x000001 Jun 9 1996 /dev/kmem
crw-r----- 1 bin sys 3 0x000000 Jun 9 1996 /dev/mem