Managing Systems and Workgroups: A Guide for HP-UX System Administrators

Contents
27
The /etc/passwd File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
Eliminating Pseudo-Accounts and Protecting Key Subsystems . . . . . . . . . . . . . . . 750
System Access by Modem. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
Protecting Programs from Illegal Execution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 752
Managing Access to Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753
Using HFS Access Control Lists (ACLs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 754
HFS ACLs and HP-UX Commands and Calls . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756
Using JFS Access Control Lists (ACLs). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Definition of a JFS ACL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
The Minimal JFS ACL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 758
Additional JFS ACL User and Group Entries. . . . . . . . . . . . . . . . . . . . . . . . . . . . 759
JFS ACL Class Entries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
Class entries are distinct from owning group entries . . . . . . . . . . . . . . . . . . . 760
Effect of chmod on class entries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
Example of JFS ACL class entries. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
Default JFS Access Control Lists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
How the System Generates a JFS ACL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Examining a JFS ACL with getacl. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 765
Changing the JFS Access Control List of a File with setacl. . . . . . . . . . . . . . . . . 767
Using setacl -m . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
Using setacl -d . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 767
Adding or changing multiple entries with setacl . . . . . . . . . . . . . . . . . . . . . . . 767
Using setacl -f . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
Effective Permissions and setacl -n . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 768
Comparison of JFS and HFS ACLs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 769
Functional Differences Between JFS and HFS ACLs. . . . . . . . . . . . . . . . . . . . . . 769
JFS and HFS Command and Function Mapping . . . . . . . . . . . . . . . . . . . . . . . . . 770
ACLs in a Network Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
Setting Default Permissions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
Protecting Directories. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 771
Protecting User Accounts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Security Considerations for Device Files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 772
Protecting Disk Partitions and Logical Volumes . . . . . . . . . . . . . . . . . . . . . . . . . . . 773
Guidelines for Running a Secure System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 774
Guidelines for Handling Setuid and Setgid Programs . . . . . . . . . . . . . . . . . . . . . . . 774
Why Setuid and Setgid Programs Can Be Risky. . . . . . . . . . . . . . . . . . . . . . . . . . 774
How IDs are Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 775
Guidelines for Limiting Setuid Power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776