Solved

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

Posted on 2009-07-09
2
1,690 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Trying to make SNMP connection work 7 66
AWS CLI - Issue with name display 2 51
Linux  Script File Attributes 5 53
how to install java on RHEL image on EC2 4 13
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

864 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

18 Experts available now in Live!

Get 1:1 Help Now