I know that setting umask
to 000
causes potential security issues. I don't care. I only want to know if something bad happens if I do it as root (sudo umask 000
), or in /etc/init.d/rc
script. By something bad, I mean breaking packages or essential parts of the system.
sudo umask 0000
will fail becauseumask
isn’t a program. It’s a shell built-in command that affects the current shell session. Nosudo
is needed or allowed, thoughsudo
commands (and other user switching) don’t inherit the currentumask
. To setsudo
to use a certainumask
, another answer gives the solution (I modified it to use0000
instead):Since the default Ubuntu
umask
is0002
(except0022
forroot
), setting it to0000
will merely no longer block an application from giving write permission to everyone other than the file’s owner or group when creating a new file. The application then doesn’t have to give write permission to others when creating a file, but now it can.It’s not recommended to set this globally for security reasons (perhaps in
~/.bashrc
instead), but it’s not likely to cause issues other than bad security when badly-written applications don’t set the permissions properly when creating files.