United States-English |
|
|
HP-UX System Administrator's Guide: Security Management: HP-UX 11i Version 3 > Chapter 6 File System SecurityControlling File Access |
|
Working groups, file permissions, file ownership, and compartment rules determine who can access a given file. The simplest of the file access rules are standard UNIX file permissions. You can divide users into groups so that files owned by the group can be shared within the group and can be protected from outsiders. The traditional UNIX file permissions are displayed using the ls command with the -l flag. The permissions indicate what kind of access (that is, the ability to read, write, and execute) is granted to the owner and groups on your system. Traditional UNIX file protections allow some control over who can access your files and directories, but they do not allow you to define access for individual users and groups beyond the owning user and the owning group. The following is a brief review of UNIX file permissions. Each file and each directory has nine permissions associated with it. Files and directories have the following three types of permissions:
These three permissions occur for each of the following three classes of users:
The r permission allows users to view or print the file. The w permission allows users to write (modify) the file. The x permission allows users to execute (run) the file or to search directories. Figure 6-1 shows the traditional permissions fields. The user/owner of a file or directory is generally the person who created it. If you are the owner of a file, you can change the file permissions with the chmod command. The group specifies the group to which the file belongs. If you are the owner of a file, you can change the group ID of the file with the chgrp command. The meanings of the three types of permissions differ slightly between ordinary files and directories. See Table 6-1 for more information. Table 6-1 Differences Between File and Directory Privileges
The chmod command changes the type of access (read, write, and execute privileges) for the file's owner, group members, or all others. Only the owner of a file or a user with the appropriate privileges can change file access. See chmod(1). By default, the initial set of read and write permissions for files and directories are determined by the creator's umask value. To change the default file permissions, use the umask command. See umask(1). Each bit that is set in the file mode creation mask causes the corresponding permission bit in the file mode to be cleared (disabled). Conversely, bits that are clear in the mask allow the corresponding file mode bits to be enabled in newly created files. For example, a umask of octal 022 creates a mask of u=rwx, g=rx, o=rx, which disables group and other write permissions. The chown command changes file ownership. To change the owner, you must own the file or have the appropriate privileges. The chgrp command changes file group ownership. To change the group, you must own the file or have the appropriate privileges. For more information, see chown(1) and chgrp(1). Normally, if a directory is writable either through standard permissions or through ACLs, anyone can remove the files in the directory, regardless of the permissions on the files themselves. To protect against unwanted file deletions in a directory:
Follow these guidelines to protect files related to user accounts:
The following problems can indicate a corrupt file system:
If you or other users cannot readily identify problems with the file system, use the fsck command to check the file system. The fsck command is the primary tool for finding and correcting file system inconsistencies. The fsck command examines the file system listed in /etc/fstab. The fsck utility is not capable of detecting file corruption. If fsck does not find any errors, the problem is likely not a corrupted file system. That is, the file system is usable, even if the underlying data is lost or corrupted. Look for one or more of these other file problems:
|
Printable version | ||
|