Solved

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

Posted on 2009-07-09
2
1,773 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Suggested Courses

632 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