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??
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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
3. Shell Programming and Scripting
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
4. UNIX for Dummies Questions & Answers
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
5. UNIX for Dummies Questions & Answers
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
6. UNIX for Dummies Questions & Answers
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
7. UNIX for Dummies Questions & Answers
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
8. Shell Programming and Scripting
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
9. Solaris
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
10. 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
chown(1B) SunOS/BSD Compatibility Package Commands chown(1B)
NAME
chown - change owner
SYNOPSIS
/usr/ucb/chown [-fR] owner[.group] filename...
DESCRIPTION
chown changes the owner of the filenames to owner. The owner can be either a decimal user ID (UID) or a login name found in the password
file. An optional group can also be specified. The group can be either a decimal group ID (GID) or a group name found in the GID file.
In the default case, only the super-user of the machine where the file is physically located can change the owner. The system configura-
tion option {_POSIX_CHOWN_RESTRICTED} and the privileges PRIV_FILE_CHOWN and PRIV_FILE_CHOWN_SELF also affect who can change the ownership
of a file. See chown(2) and privileges(5).
OPTIONS
The following options are supported:
-f Do not report errors.
-R Recursively descend into directories setting the ownership of all files in each directory encountered. When symbolic links are
encountered, their ownership is changed, but they are not traversed.
USAGE
See largefile(5) for the description of the behavior of chown when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes).
FILES
/etc/passwd Password file
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO
chgrp(1), chown(2), group(4), passwd(4), attributes(5), largefile(5), privileges(5)
SunOS 5.10 21 Jun 2004 chown(1B)