Changing PermissionsYou can change the permissions for a file using the Properties screen shown in Figure 9-2. To open the permission screen, right-click the file to be changed and select Properties. Then, click the Permissions tab. Figure 9-2. File information.[View full size image] ![]() chmod accounttypes -permissions filename chmod accounttype s=permissions filename The three account types are indicated by letters: u for user (owner), g for group, o for others, and a for all account types. The three permissions are r, w, and x, as discussed previously. The three symbols that assign permissions are + (plus) to add permissions, - (minus) to remove permissions, and = (equal sign) to set new permissions. Thus, one command might be:chmod g+w file1 The command gives write permission to the group for a file named file1. It doesn't change any other permissions for the file. If the group already had read permission, it still has read permission. Another command might be:chmod g-w file1 The command removes write permission to the group for the file without changing any other permissions for the file. Another command might be:chmod go=x file1 The command gives execute permission to group and all accounts on the file. Group and all other accounts are not given read or write permissions. Because u was not specified in this command, the permissions for the owner are not changed. You can set all permissions at once using:chmod a=r file2 The a means all usersall three account types. All user accounts on the system can now look at the contents of file2. However, they can't write or execute it. |