Is there an ideal chmod for /tmp (with /var/tmp symlinked to /tmp)?

I've seen people mention it both ways just curious as to the difference.

Is it a security difference?

up vote 6 down vote accepted

Setting it to 1 sets the sticky bit. Setting it to octal 3 is actually setting octal 2, which is setting the setgid bit, and setting octal 1, the sticky bit.

When the setgid bit is set on a directory all files (or directories) created in that directory will belong to the group that owns the directory. When the sticky bit is set only the owner and root can delete it.

The norm for /tmp is 1777.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.