Jump to content

change permissions via CLI?


Recommended Posts

How can I change user permissions through CLI. Because I am assuming it is the same as windows so to speak so I should be able to deny user permissions to Konquerer in each profile or user account. If there is a way to do it through the GUI that would be great too. I just haven't figured it out yet. Thanx.

Link to comment
Share on other sites

mysticpain:

Ill try and get round to a unix permissions tutorial at some time...Im just busy now. Pernmissions aRE EASY to change but you need to understand them first...

 

*nix Permissions: (Made Simple)

 

Firstly permissions in unix refer to either the owner of the file a group of people or everyone.

A user can only have a single UID (user ID) but mutliple groups although they must have a primary one.

 

 

*nix more or less treats EVERYTHING as a file, from the keyboard to a modem so this is a pervasive analogy.

 

So quickly, for a single file it can (must) have permissions for Owner, Group and World (o,g,w)

In other words a file can (indeed must) be owned by a owner and belong to a group but everyone in their group(s) or the whole world can be given access.

just to make it more complex and add control this depends on attributes too. In a simple sense these are Read, Write and Execute. (r,w,x)

 

Thus we have a ownership and an attribute for each and every file.

 

Reading and writing are simple enough, execute means to run a file but in the case of a directory it is also the permission to change directory (cd) to that directory.

 

Using '-' to signal no permission and '+' to signal a permission lets take a file called myfile

myfile o=+r +w -x would therefore mean the owner can read or write the file but not execute it.

This is obviously verbose becuase the same permisisons need to be repeated for the group and world. (myfile o=+r +w -x g=+r -w -x w=-r -w -x )

 

Remember the file itself also has an owner and a group for these permissions to apply to.

 

This is described to the OS in binary.... each party (as in owner,group,world) can either read/write/execute or not. (Now a zero is a not )

 

Imagine nowe we have two series....

ooo,ggg,www

rrr,www,xxx

 

Its much simpler if we say...

ooo,ggg,www and say the order of each is r,w,x giving

 

ooo ggg www

110 100 000

i.e.

Owner = rw, group=w and world = nothing.

Or

ooo ggg www

111 101 001

Owner = rwx, group=r,w and world = x

 

Now this 111101001 is a bit of a mouthful and we can use the three 3-bit binary numbers that represent this as (b=binary number and d=decimal)

each number is from left to right 4,2,1 = 7 in total. (i.e. 8 in binary is 1000)

b111=d7, b101=d5 and b1=d1

 

Thus permissions like 775 = 111,111,101 or rwx,rwx,rx

 

The chmod command is used to set these permissions.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...