I accidentally executed umask 077
while in the folder /etc/apt
. What are the consequences of this? Could I have broken something? How can I undo it?

- 117,780

- 31
-
077 means that no-one but the owner is able to read or execute newly-created files. – graham Sep 22 '20 at 08:39
-
https://askubuntu.com/questions/44542/what-is-umask-and-how-does-it-work has what you need to know. – Rinzwind Sep 22 '20 at 08:42
-
@user24601 so what should i do to undo umask 077? – jayden Sep 23 '20 at 05:40
2 Answers
umask is not folder specific, but tells applications what default permissions to give newly created files. The default umask is 022 which disables group and world write permissions.
If instead you did a chmod to change the permissions of /etc/apt, you can execute the command "chmod /etc/apt 755" to restore its proper permissions.
This is what you should see:
ls -latd /etc/apt
drwxr-xr-x 7 root root 4096 Aug 21 2019 /etc/apt/

- 39
If you executed umask
and then did not write anything to that folder, you probably didn't make any changes, because umask
applies only to "future", ie. to new files that are created after execution of the umask
command.
Value set by umask
stays effective until you execute the next umask
command or until you end the terminal session where you executed the command (which you probably already did).
So probably you didn't change anything and there's nothing to undo.

- 10,353