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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • 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. Inconsistent Device Names Across Reboot Cause Mount Failure Or Incorrect Mount in Linux
  2. How to Transfer files securely using SCP Command in Linux
  3. How to Boot into Rescue Mode or Emergency Mode Through Systemd in CentOS/RHEL 7 and 8
  4. How to enable additional scsi logging in CentOS/RHEL
  5. How to recover from a corrupt RPM database (rebuilding an RPM database)
  6. How to burn an ISO to CD or DVD using Wodim
  7. CentOS / RHEL 6,7 : How to increase system log message verbosity (rsyslogd)
  8. Unmounting a Windows Share Fails in Linux
  9. TCP Wrapper (hosts.allow & hosts.deny) Command Options in Linux
  10. Detect rootkits & malware on Linux Servers using rkhunter

You May Also Like

Primary Sidebar

Recent Posts

  • nixos-rebuild Command Examples in Linux
  • nixos-option: Command Examples in Linux
  • nixos-container : Command Examples in Linux
  • nitrogen Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright