Download presentation
Presentation is loading. Please wait.
1
Security and File Permission
Chapter 4 Security and File Permission
2
Users and Groups
3
The groups Command UNIX provides a command, groups, to determine a user’s groups. groups with no user id responds with your group.
4
Security Levels There are three level of security: system, directory, and file. The system security is controlled by a superuser. The directory and file securities is controlled by the users who own them.
5
System Security System security controls who is allowed to access the system. When the system administrator opens an account for you, he creates an entry in the system password file. You can look at this file, but only a superuser can change it. Passwords are encrypted.
6
Permission Codes Both the directory and file security levels use a set of permission codes to determine who can access and manipulate a directory or file.
7
The chmod Command To change the permissions we use the chmod command.
8
Changing Permissions
9
Symbolic chmod Codes u user g group o others a all
= to change all permissions in a set +/- to add/remove one or two permissions in a set.
10
Octal chmod Commands All the permission codes are changed.
In an octal digit, there are three bit positions. The three different permissions for each set correspond to the three bit position in an octal digit.
11
Masks The default permissions are 777 for a directory and 666 for a file. The user mask can be used to change the default permissions. The mask contains the octal setting for permissions that are to be removed from the default. mask directory permission file permission 000 (Public) (rwx rwx rwx) 666 (rw- rw- rw-) 011 (Public) (rwx rw- rw-) (rw- rw- rw-) 022 (Write protected) (rwx r-x r-x) (rw- r-- r--) 007 (Project private) (rwx rwx ---) (rw- rw- ---) 077 (Private) (rwx ) (rw )
12
The umask Command To display the current user mask settings, use the umask command with no argument. To set it, use the command with the new mask setting.
13
The chown Command Only a current owner or a superuser may change the ownership. The new owner is a login name of a user id. The group is optional. The group is a group name or a group id.
14
The chgrp Command To change the group without changing the owner, you use the change group (chgrp) command.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.