Please help me understand the below on permissions: Let us say, if I have a directory with 700 permission created with user id user1 Now user1,user2,user3,user4 all belong to a group called USER So, in this case, will the user2,user3,user4 will have full access to directory since they all belong to same group USER like user1.
Permissions are there to help prevent random users reading your confidential files and splatting on your precious data, whether accidentally or for vandalism.
You should learn how to use permissions to protect yourself. And you should consider, for every directory and file, who needs it, why, and when.
Just giving group and other permissions to everything is negligence.
You didn’t gave the permission to others as well as group
also.
Hi,
First permission for user and second permission for group
you must add permission for group to can access that directory.
Alternatively, there is another syntax for “chmod” command.
Issue “man chmod”, you’ll see you can use descriptors such as
g for group
u for user
o for others
a for all
chmod guo+rwx is equivalent to chmod 777
chmod guo+rw-x is equivalent to chmod 666
Tried on Debian, AIX
Hi,
If you want to only allow owner and its group to access the folder and the other users have no access to it you have to set user/group part in permission to be 7 (something like 770).
If you want user/group/everyone to READ a FOLDER (see the folder) they have to have at least Execute+Read=5 permission 7 means RWX and includes it so it’s OK.
The calculation is:
X : 1 (Execute)
W : 2 (Write)
R : 4 (Read)
For example:
If you want X+W it will become 1+2=3
0 — 000 All types of access are denied
1 --x 001 Execute access is allowed only
2 -w- 010 Write access is allowed only
3 -wx 011 Write and execute access are allowed
4 r-- 100 Read access is allowed only
5 r-x 101 Read and execute access are allowed
6 rw- 110 Read and write access are allowed
7 rwx 111 Everything is allowed
But there is a hidden part in file/folder permission (specially used in folders like temp, …) that I think for now you don’t need to know.
Check the folder by:
ls -la folder_parrent_location
Check the owner/group/permission
For more info:
http://www.zzee.com/solutions/linux-permissions.shtml
They have calculators on the web for these purposes.
I always use chmod 774, which allows the user and everyone in the user’s group to read, write, and execute the file or directory.
Everyone else, not in user’s group, can only read and write to file or directory.
Hope this is helpful.
Christine
Answer to this question is: No. The users user2,user3,user4 can’t perform any operations on the file.
Permissions:
read —> r—will be value 4
write —> w–will be value 2
execute—> x----will be value 1
All together, the total of those values will be 4+2+1=7
In a directory, if you see any files, they will have 3 kinds of permissions:
rwxrwxrwx… First rwx—> refers to the permissions given to the owner of that file,
Second rwx ----> refers to the permissions given to the person of that group
Third rwx ----> referes to the permissions to the rest of the others(which is not the owner & the persons of that group)
Eg:
If a file or directory has the following permissions on file or a directory.
rwxr_xr_ _ sspuliv etlgroup siva.dat
Then,
sspuliv ----> User Has all the accesses to that particular file(read,write,execute permissions on that file)
etlgroup----> “sspuliv” belongs to the group “etlgroup” here. All the people, who belongs to this group have READ and EXECUTE Permissions.
Others ----> People who don’t belong to this group or others, has only READ only Access to this file
Hope this understands.
Siva Sankar Pulivarthi
Hi,
700 means owner can read write or permission to change to directory.
770 means owner and group have full permissions.
777 means all (user group other) have full permissions on this directory.
No, 700 mean only owner of the directory have read, write and exec (in sense of directory mean you can change to this directory)
Regards,
Romeo Ninov
No, only user1 will have access.
In order to do what you want, the mode must be 770 instead of 700.
Antonio Vasconcelos