Score:0

How to set default file permissions for files created via GUI?

mx flag

How do I set default file permissions for files created via the GUI--e.g., in Nautilus, LibreOffice, or any other desktop application?

The default 775 for directories and 664 for files is far too permissive for my taste. I don't use ACLs (or, at least, not to my knowledge).

I have tried setting umask in ~/.profile and ~/.bashrc, but these do not appear to have any effect.

Thanks.

hr flag
It's done via `pam_umask` AFAIK, using values from /etc/login.defs - see related [Umask for the SFTP users](https://askubuntu.com/a/1328704/178692)
Bolio avatar
mx flag
@steeldriver That did it. Thank you.
Score:1
mx flag

The correct answer is:

sudo chfn -o umask=xxxx someuser

where xxxx is the four-digit umask and someuser is the user's name. This adds a field to /etc/passwd specifying the umask for the user in question.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.