I had the same problem and solved it the following way. I'm using Ubuntu, so the solution will be very close to your problem, provided you are using systemd. And I suppose you do, because it's the default init on Debian.
Since KDE Plasma is launched by systemd unit, the best way to set umask is to use drop-in configuration file for a particular systemd service. Especially setting umask via ~/.profile
or /etc/profile
doesn't work anymore.
Most likely all your applications are launched directly or indirectly by plasmashell
process and inherit umask from this process. The responsible systemd unit for this process is /usr/lib/systemd/user/plasma-plasmashell.service
. In order to make plasmashell
have umask=0027
you have to make drop-in configuration file: /etc/systemd/user/plasma-plasmashell.service.d/override.conf
which corresponds with aforementioned systemd unit. Make the /etc/systemd/user/plasma-plasmashell.service.d/
directory, then make a override.conf
file in it. The contents of the file should be:
[Service]
UMask=0027
Be careful to use capital "U" and "M".
This file will be processed on top of the corresponding unit file by systemd.
Restart your system and you will notice that files you create will have proper permissions. Of course if you log into virtual terminal, the umask will not be governed by this systemd setting. You can set umask additionally in ~/.profile
to have proper permissions of files created in pure text environment.
My solution is partially based on this
article from Arch Wiki