12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

118CHAPTER 4Understanding <strong>Linux</strong> ConceptsThe s permission is used on directories to retain the user or group ID for a file created inthe directory. To set the user ID for any new files created in the directory to the owner ofthe directory, use the chmod u+s command. To set the group ID for any newfiles created in the directory to the directory’s group, use the chmod g+s command.The sticky bit permission for files is no longer used. It was used on older systems to storeexecutables in memory so they run faster, but with the current virtual memory system,the sticky bit is no longer needed. If the sticky bit (the t permission) is set for a directory,the directory can only be unlinked or renamed by the root user or the owner of the directory.If the sticky bit is not set for a directory, anyone with write permission can delete orrename the directory. If the sticky bit is set for a directory, the permissions listing lookssimilar to the following (notice the t in the last set of permissions) :drwxrwxrwt 22 root root 4096 Mar 30 10:57 /tmpThe last three permissions (u, g, o) are only used with the = operator to set permissions forthe owner, group, others, or everyone equal to the existing permissions for the owner,group, others, or everyone. For example, chmod g=u sets the group permissionsto the current permissions for the owner of the file.TIPTo change permissions recursively (on all the files in a directory, all the files in itssubdirectories, all the files in the subdirectories of the subdirectories, and so on) usethe -R option to chmod such as chmod -R g+w output.txt.Examples include the following:. chmod ug+rw Gives the user and group read and write permissions. chmod -R g+r *Gives the group read permissions for all files in the current directory and any filesand directories in the current directory, recursively. chmod o-x Does not let users who aren’t the owner or in the group change into the directoryFile permissions can also be set graphically using the Nautilus file browser. From thedesktop, click on the Places menu on the top panel and select Home Folder. Navigate tothe file you want to view or change permissions for, right-click on it, and selectProperties. Click on the Permissions tab as shown in Figure 4.10 to view the existingpermissions or change them.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!