umask is a UNIX command to set the default permissions for newly created files and folders. Especially when you have to share your files with other users on your computer or on a network share the default umask of 022 which Mac OS X uses is not very handy, it would be better if all users of a group could write files by default. For that a umask of 002 is needed.
Apple has a knowledge base article addressing this issue. It’s quiet easy, all you have to do is to create two files in /etc in your terminal. You need to have administrator level on your system to do that:
/etc/launchd-user.conf
1 | umask 002 |
/etc/launchd.conf
1 | umask 002 |
4 comments
Roland says:
%A %B %e%q, %Y at %I:%M %p (UTC 2 )
Das bedeutet dann aber, daß diese Änderung bei allen neu angelegten Dateien/Verzeichnissen wirksam wird. Kann man das denn irgendwie eingrenzen auf Dateien im Verzeichnis /Füralle Benutzer?
Wolfgang says:
%A %B %e%q, %Y at %I:%M %p (UTC 2 )
soviel ich weiss, gilt die umask dann für _alle_ neuen dateien und ordner, wie man das verhalten auf einzelne verzeichnisse einschränken kann ist mir nicht bekannt
sollt ichs mal rausfinden, wird das ergebnis natürlich hier hinzugefügt.
Frank says:
%A %B %e%q, %Y at %I:%M %p (UTC 2 )
Schreibe einfach umask 002 in die .bash_profile des jeweiligen User Verzeichnisses. Wenn die Datei nicht existiert dann kann man diese einfach im Terminal anlegen mit:
echo umask 002 > ~/.bash_profile
Frank says:
%A %B %e%q, %Y at %I:%M %p (UTC 2 )
Noch eleganter geht es mit:
sudo vim /etc/launchd-user.conf
dort hinein schreiben
umask 002
und neu starten. Allerdings ist eine umask 002 aus sicherheitstechnischen Gründen
nicht zu empfehlen