Solved

E212: Can't write a file on /tmp on Linux

Posted on 2009-07-09
2
1,686 Views
Last Modified: 2013-12-15
I have a problem with writing a file to /tmp as normal user (not root). I got this error when I wanted to write with vi.
-------
"/tmp/test.txt"
"/tmp/test.txt" E212: Can't open file for writing
------
ls -ld /tmp
drwxr-xr-x 11 root root 4096 Jul  9 12:17 /tmp
uname -a
Linux xxx-yyy 2.6.18-128.el5 #1 SMP Wed Dec 17 13:41:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
Do you know which part I need to check?
0
Comment
Question by:jl66
2 Comments
 
LVL 23

Accepted Solution

by:
Maciej S earned 300 total points
ID: 24816775
You are missing sticky bit on your /tmp. Additionally your user (unless it is root) is not permitted to create files in /tmp.
Run as root:
chmod 1777 /tmp
0
 
LVL 40

Assisted Solution

by:omarfarid
omarfarid earned 200 total points
ID: 24816853
run commands below

chmod 777 /tmp
chmod +t /tmp

and try again
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now