The correct permissions needed on a Linux/Unix system for the /tmp and /var/tmp folders.

The /tmp and /var/tmp directories require different permissions to the other root directories. They need to be readable, writeable and executable by anyone but also need to have the Sticky Bit enabled.

The Sticky Bit means that whilst anyone can write to the directory, only the owner and root and edit or remove a file. This is denoted by the ‘t’ in the permissions string below:


# ls -l /tmp
drwxrwxrwt 21 root root 12288 Aug 09 12:37 /tmp

You can change the permissions using CHMOD with a ‘1’ before the normal all access 777 directory permissions:


# chmod 1777 /tmp
# chmod 1777 /var/tmp

Leave a Reply

Your email address will not be published. Required fields are marked *