I am running Ubuntu 20.04. When I create a new file, say with LibreOffice Calc, the permissions of that file are
What can I do so that the file is automatically created with the permissions beingCode:-rw-rw-r--
Code:-rw-------
I am running Ubuntu 20.04. When I create a new file, say with LibreOffice Calc, the permissions of that file are
What can I do so that the file is automatically created with the permissions beingCode:-rw-rw-r--
Code:-rw-------
The search term to find what you're looking for is 'umask'.
Holger
Thank you. Where should this be set? I already set it to 077 in
.bashrc
.gnomerc
.profile
but this does not affect the behavior of LibreOffice when creating files.
I am still wondering about this in standard Ubuntu. It's still an issue in 21.04. Specifically, in which file should the desired umask 077 be set so that all new files created will have permissions set to
As I mentioned before, setting the umask inCode:-rw-------
.bashrc
.gnomerc
.profile
does not work even after logging out and logging back in.
I changed the umask in ~/.profile overriding the default 022 with 077. Then I ran
Seems to work as advertised.Code:seiji@Linux:~$ source .profile seiji@Linux:~$ touch test seiji@Linux:~$ ls -l test -rw------- 1 seiji seiji 0 Apr 24 10:28 test
If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.
Blog · Linode System Administration Guides · Android Apps for Ubuntu Users
I get the same result as SeijiSensei when I create a new file with touch.
But if I create the file with gedit, I still get
So my question still stands.Code:-rw-rw-r--
That's clearly a bug in gedit and has been for years. Open a bug with the Gnome guys for ignoring a proper umask set in the files which should be run at login, BEFORE any GUI session begins.
https://ubuntuforums.org/showthread.php?t=2364921
The bug is inPoettering... erm ... systemd.
If Nautilus and gedit is the issue do this - but note that it will not do jack for LibreOffice so it does not answer the original question. And don't forget to logoff and log back in again:
https://askubuntu.com/questions/1322628/how-to-set-umask-to-u-rwx-g-rwx-o-rx-for-all-ways-of-logging-in-without-root-pri
Last edited by Morbius1; June 6th, 2021 at 01:46 PM.
See the link below for a discussion of this.
For Ubuntu >= 20.04, you need to edit /etc/login.defs.
You will need to edit two entries:
UMASK 077
USERGROUPS_ENAB no
As noted in the file, if you do not change USERGROUPS_ENAB from the default "yes", then user permissions will be used as group permissions, eg 077 will become 007.
However, again as noted in the file, changing USERGROUPS_ENAB has other consequences.
You need to reboot for this to take effect
This works for gedit and LibreOffice on 21.04 at least.
https://askubuntu.com/questions/9294...n-ubuntu-17-04
Last edited by philhughes; June 6th, 2021 at 03:25 PM.
Thank you, philhughes. This worked for me. Thread marked as solved.
Bookmarks