1827245 Members
2211 Online
109716 Solutions
New Discussion

permission question

 
SOLVED
Go to solution
Ragni Singh
Super Advisor

permission question

Hey everyone.

What does this actually mean". I have a directory called .(dot). It has permission 750 on it and is owned by root. As root I am able to work in it but as soon as login as sanman and do things, I get permision denied. Is it becasue only root can do things in the current dir and noone else?. Any input will be greatly appreciated and points will be given.
6 REPLIES 6
Peter Kloetgen
Esteemed Contributor
Solution

Re: permission question

Hi Sanman,

750 permission means, root as owner has read-write-execute permission, the group has read and execute- permission, the rest of the world has no permissions.

rwxr-x--- are the permissions
7 5 0
read=4, write=2, execute=1 if set, then simply add the numbers, do that for all three possibilities and write them together.

do a long listing to find out the owner and the group...

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Christopher McCray_1
Honored Contributor

Re: permission question

Saanman,
As you well know, 750 means that the owner has permission to do whatever, the group has read and execute and no one else can do anything. So, if you do not at least belong to the group assigned the file ( by the way, . typically means directory in which you are -- $PWD), you cannot do anything. You need to change permissions as root or apply the suid bit.

Hope this helps
Chris
It wasn't me!!!!
Peter Kloetgen
Esteemed Contributor

Re: permission question

Hi Sanman,

the actual working directory is shown as . in a listing, as you can prove with the following command:

ls -ld .

---> shows you the entry for the directory, but not for it's contents. ( man ls )

Each directory has two entries which you see when you do ls -a:

. --> the directory itself
.. --> the parent directory, in which directory is stored

These entries can't be deleted.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Ceesjan van Hattum
Esteemed Contributor

Re: permission question

As Peter explains, permissions are set by rwxrwxrwx codes.
The first three characters is for the owner, the next three for the group and the last three for the rest of the world.

If the Current Directory (ie ".") needs to be shared by multiple users, make sure that these users are members of the same group (/etc/passwd; /etc/group).
If in the same group, then ---rwx--- settings are valid.

Use chmod to set the permissions and chown to set PID and GID(group-id):
chown sanman:users .

Success
Roger Baptiste
Honored Contributor

Re: permission question

hi,

. is the notation for current directory.
In any directory, if you do
#ll -a, you can see the listing of dot and twodots. Dot is another way for unix to figure out what directory is it currently sitting on. (pwd).

Given that it is a directory and has permissions of 750 with ownership of root, it implies that other users (non-root) cannot gain access to that directory, since the -x bit (the last bit -0 ) is not enabled. If you make it 754, you should be able to read the contents of the directory .

HTh
raj
Take it easy.
K.Vijayaragavan.
Respected Contributor

Re: permission question

Hi,

If you want to change the permissions for the "." folder,
use the command "chmod u=rwx,g=rx,o= ."

this will set it's permission
to 750.

As the other users are not having any permission to do with something with this " ." directroy, they will get "permission denied"

If you want others to atelast read your directory,
then you can use "chmod o+r . " command.

Then your directory permission will become 754.

If sanman and root ids are owned by you and you want access to the folders owned by root then you can become the member of group called root by editing /etc/group file.

see "man group"

-K.Vijay

"Let us fine tune our knowledge together"