Sticky bits and umasks


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Sticky bits and umasks
# 1  
Old 04-12-2009
Sticky bits and umasks

ive been looking at sticky masks and umasks but still slighty unclear how i can use them my enviroment.
I currently have 1 folder for which any file that is copied to this or moved here has its permissions set to 555.

Ive tried setting the sticky bit on the folder by using chmod -t and chmod 1555 but when i try and create a new file within this folder the permissions are still incorrect...

Can anyone help me out ??
# 2  
Old 04-12-2009
A chmod of 555 on a folder means no one can write to it, I think you want a chmod of 1777 like /tmp has so that anyone can write to the folder but only the owner of a file or directory may delete it, is that what you are after?
# 3  
Old 04-12-2009
the folder is for my file sevrer so i need everyone to have read / execute access to it and the child files but i only want root to be able to write files to the folder....

And when i add a file to this folder i want the folder to have the same permissions...
# 4  
Old 04-12-2009
If you want files to have the same group owner as the directory then you can set the group sticky bit (chmod g+s), if the folder is not world writeable then the user has to be a member of that group (secondary or primary), I can't think how you can allow users to write files into a folder without them having permissions to create subfolders.

If you have a directory /export/foo with a subdirectory called bar:
1. You want users to be able to create files in foo.
2. Only root may create files in bar.
3. Users to be able to only read/list/access files in bar.
4. Files in bar have the only read/execute permissions for non-root users.
then:

Code:
# chown root:groupname /export/foo
# chmod 1770 /export/foo
# chmod g+s /export/foo
# chown root:root /export/foo/bar
# chmod 750 /export/foo/bar
# chmod g+s /export/foo/bar

The umask for the root account will need to be 027 and its primary group should be root or else it should run "newgrp root" before creating files in /export/foo/bar.
I am assuming all your users requiring access to this folder will be in a common group (called groupname in this example ).

Last edited by TonyFullerMalv; 04-12-2009 at 05:01 PM..
# 5  
Old 04-13-2009
ok cool... in the case of what im looking for what would commands would i need...

the directory in question is straight from root ... /datafarm

chown root:root /datafarm
chmod 750 /datafarm
chmod g+s /datafarm


ive add these commands but new files created in this folder still arent beng set with the required permissions.. ???
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. What is on Your Mind?

Place Bits & Win Bits!!! - 17th Annual Satellite Awards

Ten movies have been nominated as best motion picture by the International Press Academy, presentation of the 2012 Satellite Awards will be held on 16th December at Los Angeles, CA. Place your bits here on one of the below nominated movie of your choice:- Argo ... (0 Replies)
Discussion started by: Yoda
0 Replies

2. AIX

sticky bit

as far as i understand, if sticky bit is set on a directory, the files created under tht directory cannot be deleted by ordinary user... but we can do ths by permission itself,,, tht's assign only read permission to tht dirrectory wht 's the difference? (1 Reply)
Discussion started by: udtyuvaraj
1 Replies

3. UNIX for Dummies Questions & Answers

32 bits procesaor with 64 bits Solaris

people i have a problem i have a 32 bits sparc processor, and solaris 64 bits processor, i install a oracle data base 64 bits, but my oracle will not run because my processor is from 32 bits this is ok??, i know if i have x86 i cannot install a 64 bits operatin system in a 32 bits processor. ... (0 Replies)
Discussion started by: enkei17
0 Replies

4. AIX

How to convert a partition usin 64 bits kernel to 32 bits kernel?

Hello there: I know that exist a procedure to convert an OS using 32bits kernel to 64 bits kernel. But, exist a procedure to convert an OS using 64bits to 32 bits kernel? Please help me. Regards. (2 Replies)
Discussion started by: GEIER
2 Replies

5. Shell Programming and Scripting

sticky bit

Hi frns, What is command to list out all dir's for which sticky bit has been set. Regards, Manu (2 Replies)
Discussion started by: manu.vmr
2 Replies

6. Solaris

Unix Sticky Bits

I cant get the Sticky Bits idea, i do changing mod in Unix by chmod 744 for example and its mean the 7 is for owner and 4 is for group and 4 for other, how can the system determine that there is isomething before 744 which mean 00744 in this case is the 7 still for the owner and if saw how the... (3 Replies)
Discussion started by: XP_2600
3 Replies

7. UNIX for Dummies Questions & Answers

Changing 24 bits to 8 bits display

Hello all, I was wondering if anyone can tell me how to change 24 bits depth display to 8 bits depth display for Sun Ultra1, running Solaris 8? THANKS in advance. I think that the command is ffbconfig, but it has nothing about depth. (4 Replies)
Discussion started by: larry
4 Replies
Login or Register to Ask a Question