Operating System - HP-UX
1832489 Members
4496 Online
110043 Solutions
New Discussion

default 'rw-rw-rw-' permission?

 
Tan Shirley
Frequent Advisor

default 'rw-rw-rw-' permission?

What do I need to do in such a way that any files or directories created by anyone under a particular directory (example, /home/ges9) always has default 'rw-rw-rw-' permission?

Thanks !

Regards,
Shirley
4 REPLIES 4
Michael Tully
Honored Contributor

Re: default 'rw-rw-rw-' permission?

Hi,

You need to set the user's 'umask'
You should have at least a default system 'umask' in any case. This will change the mask of files being created to 644 (rw-r--r--)

In your /etc/profile add a line which reads:
umask 022
This will set this as system wide, you can of
course do this on a user by user basis should
you wish. I would suspect that your system
perhaps will many files that are like this
666 (rw-rw-rw) that you will need to fix.
To find them,
# find / -type f -perm 666 >/tmp/my666files

HTH
-Michael
Anyone for a Mutiny ?
linuxfan
Honored Contributor

Re: default 'rw-rw-rw-' permission?

Hi Tan,


I don't believe you can limit a certain umask for certain directories.

By default if you don't set a umask, it is set to 000 which means when you touch a file, it gets created with rw-rw-rw(666) permissions.

If you want to set this permissions only in this directory, you may have to write a script(run through a cron job) which periodically goes and changes the permissions.

-HTH
Ramesh
They think they know but don't. At least I know I don't know - Socrates
Santosh Nair_1
Honored Contributor

Re: default 'rw-rw-rw-' permission?

The default permissions for a file is 666, i.e. rw-rw-rw, and for a directry is 777, i.e. rwxrwxrwx. So basically if you do nothing, i.e. make sure umask is NOT set, then you will get these permissions.

However, there is not way to force the permissions from a shell session in a particular directory, its either set for everything or for nothing.

However if this directory is a samba share or an ftp dropoff then you can modifications to those applications, i.e. samba and ftpd, to force permissions for any file/directory created under this directory, but that only for files created in a samba or ftp session.

Hope this helps.

-Santosh
Life is what's happening while you're busy making other plans
Wodisch
Honored Contributor

Re: default 'rw-rw-rw-' permission?

Hello Shirley,

this is pretty easy with the proper environment :-)
But you do not have that environment, I guess :-(
The answer would be to use the "DFS" (Distributed File System) of "DCE" (Distributed Computing Environment), where you have additional permissions, especially "Initial Container ACL".
But since HP decided to NOT support it with HP-UX 11.x, you will not be able to use this feature :-(

Sorry,
Wodisch