LinuxSecurity.com
Share your story
The central voice for Linux and Open Source security news
Home News Topics Advisories HOWTOs Features Newsletters About Register

Welcome!
Sign up!
EnGarde Community
Login
Polls
How strictly do your users obey your security policies?
 
Advisories
Community
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
SELinux
White Papers
Featured Blogs
Emily Ratliff: OS Security
DanWalsh LiveJournal
Security Bloggers Network
Latest Newsletters
Linux Security Week: December 1st, 2008
Linux Advisory Watch: November 28th, 2008
Subscribe
LinuxSecurity Newsletters
E-mail:
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

  
Getting to Know Linux Security: File Permissions Print E-mail
User Rating:      How can I rate this item?
Source: Benjamin D. Thomas - Posted by Benjamin D. Thomas   
Features Welcome to the first tutorial in the 'Getting to Know Linux Security' series. The topic explored is Linux file permissions. It offers an easy to follow explanation of how to read permissions, and how to set them using chmod. This guide is intended for users new to Linux security, therefore very simple. If the feedback is good, I'll consider creating more complex guides for advanced users. Please let us know what you think and how these can be improved. If you have ideas for future topics, please post them in the discussion forum below.

Click image to begin tutorial.

Script

Hello, my name is Benjamin Thomas and I am with Guardian Digital, Inc, the primary sponsor of LinuxSecurity.com Welcome to the first of the "Getting to know Linux Security" series tutorials that will be featured on our site. Today's topic is file permissions. This lesson is primarly intended for those users who are just getting started, and other wishing to brush up old skills. The examples I show you today are from a typical Linux command line. Today, I'll be using EnGarde Secure Linux. More information about this distribution can be found at Guardian Digital.com and it can be downloaded at EnGardeLinux.org.

...

Lets Begin. To see a listing of files in a directory, execute the command 'ls'. As you'll see, there are no files in the temporary directory that I'm using. Let's first create several files.

touch file1 file2 file3

The command 'ls' then shows the files we have created. A more informative way to show the files is ls -la. The 'l' switch lists files in long format, and the 'a' switch lists all files, including hidden ones.

...

Lets look at file1 (select line) The first field reprents the file's type. For regular files this is always a dash, for directories, it will be reprented as a d. (There are other's, but beyond the scope of this lesson) The next nine represent the file's permission. The the number of 'hard' links to the file, the file owner's username, the owner's group, the file's size, its modification date and time, and the file's name.

...

Lets examine the permission field closer. The first three blocks represents the access granted to the file's owner. The next three, represent access granted to other group members, and the last three represent everyone else's level of access. The possibilities for permissions include:

r - read
w - write
x - execute
- - no permission

...

If you are the owner of a file, you have the ability to change its permissions with the chmod command. There are several ways chmod can be used, however in today's lesson I will only focus on the octal system. The first number represents the owner's permission, the 2nd represents the groups permission, and the last one' represents the world's or everyone's access. The permission is calculated using simple arimetic. 1 is for exectute permission 2 is for write permission 4 is for read permission

The permission is set using the chmod command:

chmod 755 file1

You may asking, but what does 755 mean? 7 comes from 1 + 2 + 4. 5 comes from 1 + 4. This means that the file's owner has read, write, and execute permission, but group and world only have read and execute.

...

Overtime you'll find that this method of setting permissions becomes natural. After getting comfortable with this method you'll find that Linux permisssion aren't difficult at all to understand.

...

Once again, thank you for visiting LinuxSecurity.com. I hope you have found this guide helpful and you are looking forward to other tutorials in the Getting to know Linux Security series. Please do no hesitate to send comments, questions, or ideas to me at the following email address: ben@linuxsecurity.com

...

This guide has been sponsored by Guardian Digital, creators of EnGarde Secure Linux. www.guardiandigital.com

Comments
spelling errorWritten by David on 2006-04-03 17:57:29
"arimetic" == "arithmetic" in the article. 
 
good article, though.
Written by ASIM on 2006-05-06 06:11:43
THis is my first time here on this website and I am a new user on Linux. the lecture was excellent and to the point
Linux permissions - number viewWritten by albert on 2006-06-30 09:39:52
I am linux newbee. This was easy and understandable. 
 
Thank you.
Written by Daniel C on 2006-09-07 02:49:37
Excellent Tutorial, I now finally understand what these numbers mean. Thank you!
Written by Zim on 2008-09-13 17:48:47
Useful, thanks!
thanksWritten by Tory on 2008-11-15 21:01:50
Yeeeah, that was useful, thank you

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Personal verbal attacks will be deleted.
  • Please don't use comments to plug your web site.. Such material will be removed.
Name:
Title:
Comment:

Code:* Code

Powered by AkoComment!

 
< Prev   Next >
    
Partner:

 

Latest Features
A Secure Nagios Server
Never Installed a Firewall on Ubuntu? Try Firestarter
Review: Hacking Exposed Linux, Third Edition
Security Features of Firefox 3.0
Review: The Book of Wireless
April 2008 Open Source Tool of the Month: sudo
Open Source Tool of March: ZoneMinder
Yesterday's Edition
Data Encryption and Ubuntu

QuickLinks: Comunity , HOWTOs , Blogs , Features , Book Reviews , Networking ,
  Security Projects ,   Latest News ,  Newsletters ,  SELinux ,  Privacy ,  Home,
 Hardening ,   About Us,   Advertise,   Legal Notice,   RSS,   Guardian Digital

(c)Copyright 2008 Guardian Digital, Inc. All rights reserved.