?
Solved

Posix Permissions in Linux

Posted on 2014-03-01
9
Medium Priority
?
366 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2
9 Comments
 
LVL 18

Assisted Solution

by:Gary Davis
Gary Davis earned 500 total points
ID: 39898136
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 62

Assisted Solution

by:gheist
gheist earned 500 total points
ID: 39898791
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
ID: 39899342
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 18

Expert Comment

by:Gary Davis
ID: 39899363
As a standard, Posix applies to Linux, Unix and other variants that adhere to that standard.
0
 
LVL 30

Expert Comment

by:serialband
ID: 39899719
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 62

Expert Comment

by:gheist
ID: 39899749
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 500 total points
ID: 39902872
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 30

Accepted Solution

by:
serialband earned 500 total points
ID: 39904956
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
ID: 39935679
Thank you Guys
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month9 days, 15 hours left to enroll

762 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