Systems administration & maintenance - File Permissions.pptx

wgdereje1 2 views 21 slides Sep 16, 2025
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

SysAd


Slide Content

Systems administration & maintenance class Lesson 8 – File Permissions

Permissions on Files Denoted by a letter A permission represents an action that can be done on the file Occasionally referred as permission bits Note that for script you need both Execute and Read permission

Permissions on Directories r, w and x has also meaning for directories The meanings for directories is slightly different Read r – permission to get a listing of the directory Write w – permission to create, delete, or rename files within the directory Execute x – permission to change to the directory, or to use the directory as an intermediate part of the path of a file.

Examining Permissions The ls –l command allows you to look at the permissions of a file.

Preserving Permissions By default the cp command makes no attempt to preserve permissions -p to preserve permissions and timepstamp

How Permissions apply If you own a file, the per-owner permission apply to you Otherwise if you are in the group that owns the file, the per-group permissions apply to you

Listing Directory Contents ls Compact listing on non-hidden files ls -a Compact listing of ALL files ls -l Detailed listing of non-hidden files ls -F Displays symbols to mark directories and executable files ls - ld Detailed listing of specified directory ls -i Displays i-node number ( I.d. number of files)

Access Permissions Limiting unauthorized access to your directories and files is a very important concern for ALL Linux (Unix) users. Consequences of Unauthorized Access: Copying your assignments (cheating) Using your account for illegal activity Using your account to send obscene messages Tampering with files

File / Directory Permissions The Linux (Unix) OS can allow the user to specify read , write and execute permissions to the user , group or all others (UGO) for files. A user can also specify read , write and execute permissions for a directory. The execute permission for a directory allows the person to view files in that directory

chmod Command (Relative Method) Used to change the access permissions of a file or directory Format: chmod [option] [who] [operation] [permission] file chmod [option] [permission] file-list who relates to user ( u ) , group ( g ) or all others ( o ) operation relates to adding ( + ), removing ( - ) or setting ( = ) permissions permissions are read ( r ), write ( w ) and execute ( x )

chmod Command (Relative Method) Examples: Add Permission chmod g+rw file.name chmod o+x file.name Remove Permission chmod g-w file.name chmod a-w file.name (removes write for ugo) Set Permission chmod o=rx file.name chmod go=rx filename Note: you can use wildcard symbols (eg *) to match particular files

File Access Rights Types of Users: Owner Group All/Other Types of Permissions: Read Write Execute Types of Files Directories Other files

Table 8.1 Summary of File Permissions in LINUX

Directory Permissions read = list files in the directory write = add new files to the directory execute = access files in the directory

Determining File Access Rights

Table 8.2 Permission Values

Table 8.3 Permissions for Access to courses, labs, and temp

Changing the Access Rights Purpose – to set/change permissions in files chmod [options] octal-mode filelist chmod [options] symbolic-mode filelist Options -R recursively process subdirectories

Table 8.4 Values for Symbolic Mode Components

Table 8.5 Examples of the chmod Commands and Their Purposes

Table 8.5 Examples of the chmod Commands and Their Purposes
Tags