Creare una directory scrivibile ma non eliminabile: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
| Line 19: | Line 19: | ||
If you run ls -ld /tmp, chances are that your system-wide temporary directory, used widely as application scratch space, is sticky. | If you run ls -ld /tmp, chances are that your system-wide temporary directory, used widely as application scratch space, is sticky. | ||
==Riferimenti== | |||
*[http://www-128.ibm.com/developerworks/aix/library/au-speakingunix4/?ca=dgr-lnxw06 Speaking UNIX, Part 4: UNIX ownership and permissions provide for privacy and participation] | |||
Latest revision as of 15:24, 30 November 2006
Make a directory sticky
If you want to ensure that a directory persists and isn't removed by accident, set the sticky bit by using
chmod +T directory_name
See this:
$ ls -lF drwxrwxrwx 2 strike strike 68 Aug 28 06:21 dropbox/ drwx------ 2 strike strike 68 Aug 28 06:21 mine/ $ chmod +t dropbox $ ls -lF drwxrwxrwt 2 strike strike 68 Aug 28 06:21 dropbox/ drwx------ 2 strike strike 68 Aug 28 06:21 mine/
With the sticky bit set and with permissions set to all can read, write, and execute, everyone can place files in my drop box, but I am the only user who can remove files in the directory or remove the directory itself.
If you run ls -ld /tmp, chances are that your system-wide temporary directory, used widely as application scratch space, is sticky.