Permissions on Files
Denotedby 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
3.
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.
How Permissions apply
Ifyou 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
7.
Listing Directory Contents
lsCompact 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)
8.
Access Permissions
Limitingunauthorized 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
9.
File / DirectoryPermissions
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
10.
chmod Command
(Relative Method)
Usedto 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)
11.
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
12.
File Access Rights
Types of Users:
Owner
Group
All/Other
Types of Permissions:
Read
Write
Execute
Types of Files
Directories
Other files
#1 NOTE:
To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image.