Solved

Posix Permissions in Linux

Posted on 2014-03-01
9
334 Views
Last Modified: 2014-03-17
The word Posix is used in Linux , I have checked it is definition in Google, but the usage of the word such as Posix permission, is a bit confusing to me.

Can someone give clear and simple explanation of Posix?
Thank you
0
Comment
Question by:jskfan
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 18

Assisted Solution

by:Gary Davis
Gary Davis earned 125 total points
Comment Utility
A file, for example, in Linux has a set of permissions like you the owner can read it, write it or execute it or any combination of those three permissions (rwx). If you can read but not write, it is represented as (r--).

As a number representation, read is 4, write is 2 and execute is 1. Add up the allowed permissions and you get a number from 0 to 7. If you can read and execute, the permission is a 5.

If you are in a group that has permissions to the file, you also may have a different set of those three permissions like maybe the owner has all three (7) but members of the group has only read and execute (5).

Finally, everyone else (other) has its own set of those three permissions. For example maybe other has no permissions (0).

The permissions are layed out with owner, group and other, each with the 3 characters. This example results in (rwxr-x---).

There is another position on the left that is a "d" if the entry is a directory instead of a file.

The command line command to change permissions is chmod (change mode).

More details are at http://www.thetechrepo.com/main-articles/494-understanding-file-and-folder-permissions-posix-on-linux-and-mac-os-x - Understanding File and Folder Permissions (POSIX) on Linux and Mac OS X (using chmod) .

Gary Davis
0
 
LVL 61

Assisted Solution

by:gheist
gheist earned 125 total points
Comment Utility
POSIX is a standard
E.g POSIX semantics of file permissions like on all UNIX systems:
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_04
0
 

Author Comment

by:jskfan
Comment Utility
I was trying to understand the word POSIX, what relation it has with permissions…
it is used a lot with Posix permissions…why not just Linux permissions
0
 
LVL 18

Expert Comment

by:Gary Davis
Comment Utility
As a standard, Posix applies to Linux, Unix and other variants that adhere to that standard.
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 27

Expert Comment

by:serialband
Comment Utility
POSIX stand for Portable Operating Systems Interface.  It is a family of standards set by the IEEE for operating compatibility between Unix environments.   Solaris, AIX, HP-UX, IRIX, etc... are fully POSIX compliant to some variant of the POSIX standard.

Linux is only mostly POSIX compliant and not actually certified by the standards committee.  The permissions structure in Unix and Linux follow the standards so that they are compatible to each other.  The same chmod command will work the same on every POSIX system.  It's a guaranty that they work identically in a minimal fashion.
0
 
LVL 61

Expert Comment

by:gheist
Comment Utility
POSIX it standard for minimal facilities in a UNIX system (e.g if you read it you can make shell script or C program work exactly same on any certified UNIX)

Linux equivalent is LSB.
0
 
LVL 13

Assisted Solution

by:Sandy
Sandy earned 125 total points
Comment Utility
What best i found is :

Basically it was a set of measures to ease the pain of development and usage of different flavours of UNIX by having a (mostly) common API and utilities. Limited POSIX compliance also extended to various versions of Windows.

POSIX compliant operating systems would be FBSD and Linux, yet both have rather different file system organization and default library installations.

TY/SA
0
 
LVL 27

Accepted Solution

by:
serialband earned 125 total points
Comment Utility
FreeBSD and Linux are POSIX Compliant, but not officially certified by the Open Group Standards committee.  http://www.opengroup.org/  While interesting, that's irrelevant to the POSIX permissions.  It mainly means that nobody submitted them for certification.

The organization of the files is not a part of the standard, but the description of the permission structure is.  Basically, commands such as chmod, chgrp, chown, cd, mkdir, etc... all should work the same way since the file permissions are structured the same way.  They don't care where you place every file and directory.

OSX is certified and has a different file organization and Library layout.  It has the basic file permissions as well as the standard minimal command set, but they do have numerous other commands that don't exist on any other system.  http://www.opengroup.org/openbrand/register/brand3602.htm

There's a list of them here: http://www.opengroup.org/openbrand/register/

You should also remember that POSIX is a minimal standard.  Passwords and account names can have lengths greater than 8 characters now.  POSIX certified Solaris still has utilities that only display or operate on 8 characters.  For example, I've had to download a copy of the source code for the last command from Solaris X86 to recompile on Sparc to view account names more than 8 characters from wtmp.  Linux utilities already do that and have been doing that for years.
0
 

Author Closing Comment

by:jskfan
Comment Utility
Thank you Guys
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now