……………………………………………………………………………… #chown bind:wheel file2 # ……………………………………………………………………………… Note Only
……………………………………………………………………………… #chown dns:dns file1 #chmod 664 file1 #ls -l file1 -rw-rw-r– 1 root dns 1188 Sep 14 09:35 file1 # ……………………………………………………………………………… Your staff can now do their jobs without the root password, and your files are immune to tampering by the system process that uses them. [3]In UNIX, “simplify” frequently means “make easier to say and faster to type, but more difficult to understand.” [4]You can have four-digit modes in special circumstances. See chmod(1) for details. You don’t normally use four-digit modes except on device nodes and other special files. File Flags UNIX filesystem permissions are standard across various versions of UNIX, and BSD extends the permissions scheme with file flags. These flags work with permissions to increase your system’s security. Some of these flags are used for non-security-related functions, but the ones we’re interested in here are security related. Note Many of the flags have different effects depending on the system securelevel, which will be covered shortly in the “Securelevels” section. For the moment, just nod and smile when you encounter a mention of securelevel; all will become clear in the next few pages. The following are the security-related file systems flags: sappnd The system-level append-only flag can only be set by root. Files with this flag can be added to, but cannot be removed or otherwise edited (which is particularly useful for log files). Setting sappnd on a .history file can be interesting if your system is compromised. Since a common intruder tactic is to remove.history or to symlink it to /dev/null so that the admin cannot see what was done, sappnd ensures that script kiddies cannot cover their tracks in this manner. It’s almost funny to watch the record of someone trying to remove a sappnd file. You can see the attacker’s frustration grow with the various things she tries. (It is better, of course, for your system not to be hacked at all!) This flag cannot be altered when the system is running at securelevel 1 or higher. schg The system-level immutable flag can only be set by root. Files with this flag set cannot be changed in any way, neither edited, moved, nor replaced. Basically, the filesystem itself will prevent all attempts to touch this file in any way. This flag cannot be altered when the system is running at securelevel 1 or higher. sunlnk The system undeletable flag can only be set by root. The file can be edited or altered, but it cannot be deleted. This is not as secure as the previous two flags because if a file can be edited, it can be emptied. It’s still useful for certain circumstances, however. I’ve used it to solve problems when a program insisted on deleting its own log files when it crashed. It’s not generally useful to set on any standard system flags. This flag cannot be altered when the system is running at securelevel 1 or higher. 148
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Inexpensive Web Hosting services