[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help! File permissions keep changing...





From the manual page of umask  (  man umask  ):

    umask sets the umask to mask & 0777.

The umask is used by open(2) to set initial file permissions on a newly-created file. Specifically, permissions in the umask are turned off from the mode argument to open(2) (so, for example, the common umask default value of 022 results in new files being created with permissions 0666 & ~022 = 0644 = rw-r--r-- in the usual case where the mode is specified as 0666).


What this means, is that whatever umask you specify, it is ANDed with 0777.

So an umask of 000 would yield 777 permissions, 007 would yield 770 and so on.


Hhayes wrote:
What do I need to change the 022 setting to be for -rwxrwx---  ?

"John Hardcastle" <johnhardcastle@ihug.co.nz> wrote in message
news:1qmvW-6mW-21@gated-at.bofh.it...

So the default file permissions don't do what you want.
$  umask
Read the manual page for the umask command,
$ man umask
As root, change the umask in /etc/profile to reflect the permissions you
want.
# vi /etc/profile
Then have all users logout and login again.  Their $HOME/.bashrc will
read /etc/profile and their umask will reflect your changes.

John

On 02/18/04 10:12, Hhayes wrote:


I have a Debian box running as a file server on a network with 50 users.

So

far it works great except for the user/file permissions. I can go into a

directory and set the owner and group permissions to read/write on all

files in the directory and that works fine. Then as soon as one of the

users opens a file and saves it, the permissions on that file change to

read

only for the group permissions and changes the owner to the user that

just

saved the file, resulting in a file that no other users can write to. Has

anyone ever seen this before?






--
To UNSUBSCRIBE, email to debian-security-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact

listmaster@lists.debian.org





Reply to: