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
What is the most important Linux security technology?
 
Advisories
Community
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
SELinux
White Papers
Featured Blogs
All About Linux
DanWalsh LiveJournal
Securitydistro
Latest Newsletters
Linux Advisory Watch: September 26th, 2014
Linux Security Week: September 22nd, 2014
Subscribe
LinuxSecurity Newsletters
E-mail:
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

  
File Permissions Print E-mail
User Rating:      How can I rate this item?
Source: Benjamin D. Thomas - Posted by Benjamin D. Thomas   
Learn tips and tricks Linux/Unix allows users to protect their data from access by other users.

Introduction

File permissions are usually confusing to newer Linux users. Most 'newbies' are not accustom to implementing file security because of thier DOS/Windows background. Why do we need file security? It is primarly needed to ensure data protection and privacy from other system users. In other cases, file security is needed to prevent 'normal users' (as opposed to system administrators) from changing configurations or accidently damaging a system. File permissions allow users to share selected data and programs with other users by the means of a simple but effective protection scheme.

Q. How do you know what permissions are granted for a particular file?

A. Use the command: ls -l
The first 10 characters displayed are the file type and access permissions: -rwxrwxr-x or drwxrwxr-x.

  • The first character is either - or d. A dash indicates that it is a file and a indicates that it is a directory.
  • The next 3 characters show the owner's permissions.
  • The following 3 indicate the permissions for users in the file's group.
  • The last 3 characters show the permissions for all other users.

The possibilities for permissions include:

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

Q. How do I change permissions for a particular file that I own?

A. Use the 'chmod' utility. Syntax: chmod who [operation] [permission] file(s)

Who:
-------------
u - user/owner
g - group
o - other users
a - all users

Operation:
-------------
+ add permission
- remove permission

Permission:
-------------
r - read
w - write
x - execute

File(s):
------------
List 1 or more filenames.

Examples of using 'chmod' to change permissions:

% chmod a+r /home/usr/abd01/data
This gives everyone on the system permission to read 'data'

% chmod og=, u+rwx /home/usr/abd01/protect
This takes away rwx permission from group members and all other users on the system. It also adds rwx permissions for the file owner.

Note: chmod can also be used with an octal absolute system. This method is described in another tip. ( i.e. chmod 755 filename ).

Only registered users can write comments.
Please login or register.

Powered by AkoComment!

 
< Prev   Next >
    
Partner

 

Latest Features
Peter Smith Releases Linux Network Security Online
Securing a Linux Web Server
Password guessing with Medusa 2.0
Password guessing as an attack vector
Squid and Digest Authentication
Squid and Basic Authentication
Demystifying the Chinese Hacking Industry: Earning 6 Million a Night
Free Online security course (LearnSIA) - A Call for Help
What You Need to Know About Linux Rootkits
Review: A Practical Guide to Fedora and Red Hat Enterprise Linux - Fifth Edition
Yesterday's Edition
Shellshock makes Heartbleed look insignificant
Hacker Group Lizard Squad Takes Down Destiny, Call of Duty, FIFA And More
Partner Sponsor

Community | 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 2014 Guardian Digital, Inc. All rights reserved.