Operating System - HP-UX
1837184 Members
2668 Online
110114 Solutions
New Discussion

Re: file permission set to ----------+

 
SimonD
Advisor

file permission set to ----------+

Hello,
I have a problem with file permission on a HP-UX 11.0 server.
In a jfs file system the files are created with permission ----------+ (also from root).
The umask is 000.
How can I change the default permissions for new files?
By

Simone
9 REPLIES 9
Jose Juan
Advisor

Re: file permission set to ----------+


you must use the command "umask"
see man umask, it's easy


Good Luck.
Jota.
Jose Juan
Advisor

Re: file permission set to ----------+

Here one example:

Set the umask value to produce read and write permissions for the
file's owner and read permissions for all others (ls -l displays -rw-
r--r-- on newly created files):

umask u=rwx,g=rx,o=rx symbolic mode
umask a=rx,u+w symbolic mode
umask 022 numeric mode


Jota
Peter Kloetgen
Esteemed Contributor

Re: file permission set to ----------+

Hi Simone,

this works easy with the command:

umask 022

this makes directories to get the permissions

rwxr-xr-x (755)

and files to get the permissions

rw-r--r-- (644)

because files are never executable for reasons of security, you have to make them executable!

allways stay on the bright side of life!

Peter
I'm learning here as well as helping
Bill McNAMARA_1
Honored Contributor

Re: file permission set to ----------+

This is known as the sticky bit.

See:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5c7dabe92dabd5118ff10090279cd0f9,00.html

for an explaination.

Later,
Bill
It works for me (tm)
federico_3
Honored Contributor

Re: file permission set to ----------+

set in /etc/profile

umask 022

this gives to the directories the permissions

rwxr-xr-x (755)

and files the permissions

rw-r--r-- (644)


Ciao
Federico

Ceesjan van Hattum
Esteemed Contributor

Re: file permission set to ----------+

The general umask can be set in /etc/profile.
The /etc/profile is executed before every login of every user.
type "umask -S" to check the default mask.
You can aslo set umask locak profile ($HOME/.profile).

SimonD
Advisor

Re: file permission set to ----------+

The default umask for root is already 022.
SimonD
Advisor

Re: file permission set to ----------+

FYI, we made an umount and mount of the filesystem. Now all it's working properly (file permission -rw-r--r--).
Thanks to all for the help.
Simone
Darrell Allen
Honored Contributor

Re: file permission set to ----------+

Hi Simone,

I believe "+" on the end of permissions means there are ACLs on the file. I know very little about them so I can't help with that.

It seems odd that umount and mount corrected your problem. I hope someone can post an idea about what could have been happening.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)