Dir and file privileges in AIX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Dir and file privileges in AIX
# 1  
Old 06-21-2009
Dir and file privileges in AIX

I have a question, I know for privileges, 4-READ, 2-Write, 1-Execute, so if a file has 754 privileges then owner has all privileges, folks in his groups can Read and execute that file. Others can only read the file.

So if there are three users A B C, A is the owner B is in GROUP AB and C is not in group AB. Now user C should be able to go to the subdir and be able to read the file say "file1".

So what privileges should be there, Remember people in group can read and execute the file, so that is a 5. Other should be able to just READ the file, so that is 4.

So if a dir permission looks like this

ls -la /HIGH_LEVEL_DIR
drwxr-xr-- /HIGH_LEVEL_DIR/SUBDIR1

cd /HIGH_LEVEL_DIR/SUBDIR1
ls -la
-rwxr-xr-- file1
-rwxr-xr-- file2

On AIX,
However, if user C wants to go to the subdir /HIGH_LEVEL_DIR/SUBDIR1 , we get user C does not have privileges.

So if user C wants to go to the dir "/HIGH_LEVEL_DIR/SUBDIR1", he/she gets permission denied privileges.

ls -la /HIGH_LEVEL_DIR
drwxr-xr-- /HIGH_LEVEL_DIR/SUBDIR1


If the dir access becomes

rwxr-xr-x then user can do a "Change dir (cd)" command to /HIGH_LEVEL_DIR/SUBDIR1 .

Now if he tries to read the file /HIGH_LEVEL_DIR/SUBDIR1/file1, he gets the error that user does not have enough privileges to read the file, file1.

So what is wrong here??

---------- Post updated at 12:19 AM ---------- Previous update was at 12:04 AM ----------

Do we need just 755 at /HIGH_LEVEL_DIR/SUBDIR1 level and 754 at file levels??
# 2  
Old 06-21-2009
All sub-directories to the file a user wants to read must have at least read and execute permission (whether it's for the owner, a group member, or someone else).

So in your case

ls -ld HIGH_LEVEL_DIR
drwxr-xr-x .... HIGH_LEVEL_DIR

ls -ld HIGH_LEVEL_DIR/SUBDIR1
drwxr-xr-x .... HIGH_LEVEL_DIR/SUBDIR1
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Assign read write permission to the user for specific dir and it's sub dir and files in AIX

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. I do not want to assign user the same group of that directories too.... (0 Replies)
Discussion started by: blinkingdan
0 Replies

2. Solaris

Privileges : modify dir/file owner by other that's not owner

i need to do the following operations in solaris 10: 1.change owner and group owner for files which are not owned by the current user and user group 2.to can delete files in the /tmp directory which are not of the current user 3. allow to a standard user the deletion of files in the /tmp... (1 Reply)
Discussion started by: sirmark
1 Replies

3. Shell Programming and Scripting

Create file Dir and Sub Dir same time

Hi Guys , I want create files Dire and Sub Dire. as same time using variable. EX: x1="/hk/Pt/put/NC/R1.txt" x2="/hk/pt/Put/Ot/NC/RN.txt" And i want delete all after done with my script. Thanks (2 Replies)
Discussion started by: pareshkp
2 Replies

4. UNIX for Dummies Questions & Answers

How to list all files in dir and sub-dir's recursively along with file size?

I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In have to list all the files in directory and its sub directories along with file path and size of the file Please help me in this regard and many thanks in advance. (3 Replies)
Discussion started by: nmakkena
3 Replies

5. UNIX for Dummies Questions & Answers

move files between file systems with privileges, time stamp

Hi I have to move files between file systems but files in new file system must have the same attributes as in old one (privileges, time stamp etc). Which tool is best : - ufsdump / ufsrestore - tar - cpio - pax - dd - mv Or maybe there is sth else, you suggest to use. Thx for help (5 Replies)
Discussion started by: presul
5 Replies

6. UNIX for Dummies Questions & Answers

Copying dir (and sub dir) file names from ftp server to txt file in diff server

Hey all, i want to copy only the file names from an ftp server (directory and all sub directory) to a text file in another server (non ftp), i.e. i want to recursively move through directories and copy only the names to a text file. any help is appreciated...thank you in advance (1 Reply)
Discussion started by: deking
1 Replies

7. UNIX for Dummies Questions & Answers

What is the default temp dir for UNIX AIX 5.3 and cleanup guide.

Hi, I'm new with UNIX. In fact I'm just an Oracle Apps programmer runs and maintaining the system in UNIX platform. I've got this question, what is the UNIX AIX 5.3 default temp directory. Is it /tmp or /var/tmp. Additional to that I was noted that OS also created temp/swap files in this... (1 Reply)
Discussion started by: Alikuching
1 Replies

8. Shell Programming and Scripting

Moving file(s) from dir to dir

Hi, I am fairly new to writing scripts. I am trying to write a script that moves either One or All of the files from one directory to another. I know how to make the actual command to do it, but i don't quite know how to add operators to it, ie -i or -a. I want -i to move one file from... (4 Replies)
Discussion started by: SirJoeh
4 Replies

9. Shell Programming and Scripting

Change file privileges automatically

Hi, Is it possible to write and run a shell script for specific directory( Apache/htdocs) that changes root privilege read/write to chmod 755 when a program uploads a file (word,PPT,XSL,..) to that directory Thanks, Mk (3 Replies)
Discussion started by: mkohan
3 Replies

10. Shell Programming and Scripting

copying a file from one dir to another dir

hi i have a script compareFiles() { find /tmp/Satya -type f | \ while read filename1 do echo "----------------------------------------$filename1" find /tmp/Satya -type f | \ while read filename2 do if diff $filename1 $filename2 then echo "Both files... (3 Replies)
Discussion started by: Satyak
3 Replies
Login or Register to Ask a Question