Linux File Permissions

Abhishek Chandra
May 18 · 8 min read
Image for post
Image for postImage for post

Introduction:

The List (ls) Command:

ls
Output of ‘ls’ command on my system
Output of ‘ls’ command on my systemOutput of ‘ls’ command on my system
Fig.1: Output of ‘ls’ command on my system
ls -lh
Output of ‘ls -lh’ command on my system
Output of ‘ls -lh’ command on my systemOutput of ‘ls -lh’ command on my system
Fig.2: Output of ‘ls -lh’ command on my system
ls --help
man ls

The [What X Who] Matrix:

·         r              : User can Read the file·         w              : User can Write to the file·         -              : User cannot Execute the file·         r              : Group can Read the file·         -              : Group cannot Write to the file·         -              : Group cannot Execute the file·         r              : Others can Read the file·         -              : Others cannot Write to the file·         -              : Others cannot Execute the file
Table showing the [What X Who] Matrix of the file ‘first’
Table showing the [What X Who] Matrix of the file ‘first’Table showing the [What X Who] Matrix of the file ‘first’
Table 1: [What X Who] matrix for the file ‘first’
Table showing the[What X Who] matrix for the directory ‘rasa_files’
Table showing the[What X Who] matrix for the directory ‘rasa_files’Table showing the[What X Who] matrix for the directory ‘rasa_files’
Table 2: [What X Who] matrix for the directory ‘rasa_files’

Matrix Scoring:

Table showing the meaning of the 4 octal bits
Table showing the meaning of the 4 octal bitsTable showing the meaning of the 4 octal bits
Table 3: Meaning of the 4 Octal bits
Table showing the permission scores
Table showing the permission scoresTable showing the permission scores
Table 4: Permissions Scores
Image for post
Image for postImage for post
Table 5: Permission Scores for the file ‘first’
Image for post
Image for postImage for post
Table 6: Permission Scores for the directory ‘rasa_files’

Changing the Permissions:

chmod u=x <file_name>
ls -l
Newly set permissions of the file ‘first’
Newly set permissions of the file ‘first’Newly set permissions of the file ‘first’
Fig.3: Newly set permissions of the file ‘first’
chmod 777 <file_name>
Image for post
Image for postImage for post
Fig.4: Newly set permissions of the file ‘rasa_info’
chmod --help
man chmod

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store