• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

UNIX / Linux : What is the correct permission of /tmp and /var/tmp directories

by admin

What are the correct permissions required for the /tmp and /var/tmp directories?

Answer

The /tmp and /var/tmp directories requires special permissions. This directory has Sticky Bit permissions. Many applications will show errors or fail if they are not able to write to /tmp with the appropriate permissions.

# ls -ld /tmp
drwxrwxrwt 21 root root 12288 Apr 28 16:18 /tmp

The ‘t’ at the end symbolizes that the sticky bit is set. A file created in the /tmp directory can only be removed by its owner, or the root user.

Setting up the permissions

Change the permissions on the directory by running either the following commands:

# chmod 1777 /tmp

or

# chmod a+trwx /tmp

Filed Under: Linux

Some more articles you might also be interested in …

  1. daps: open source program for transforming DocBook XML into output formats such as HTML or PDF
  2. whoami: command not found
  3. Linux OS Service ‘lm_sensors’
  4. cuyo Command Examples in Linux
  5. docker-slim Command Examples
  6. grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  7. rsync: command not found
  8. ipsumdump Command Examples
  9. pvs Command Examples in Linux
  10. What are makefiles in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright