Default File Permissions on Creation - Umask

Diposkan oleh Unknown on Friday, December 5, 2008

With the umask command you can set, what permissions a file will normally have when it's first created. It's a bit complicated, though: You have to XOR 666 for files and 777 for directories with the numerical permission code you want the file to have. (see man umask for more)

With umask you see the current mask, with umask -S you see it understandably. The default in Ubuntu is umask 022, which means that files will be -rw-r--r-- by default. With umask 026 you can prevent files from being readable and directories being accessible by "other"s (meaning anyone) by default (-rw-r-----).

You can also use the much easier symbols like with chmod, e.g. umask u=rwx.

{ 0 komentar... read them below or add one }

Post a Comment

Come on share your comment, but please do not spam