LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-05-2005, 03:10 AM   #1
rsteelman
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Rep: Reputation: 0
permission denied writing to /tmp


I have encountered a problem of creating files and removing files from /tmp directory as a root.

For example an attempt to copy a file from a different directory gets an error message as follows:

[root@panther tmp]# cp /etc/resolv.conf

cp: cannot create regular file './resolv.conf': Permission denied

Similar error message occurs in attempting to create a file with vi .

I have checked the available space and there seems to be plenty

[root@panther tmp]# df /tmp
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda1 495828 344398 125831 74% /
 
Old 02-05-2005, 03:40 AM   #2
musicman_ace
Senior Member
 
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
Re: permission denied writing to /tmp

Quote:
Originally posted by rsteelman
[root@panther tmp]# cp /etc/resolv.conf
If this is what you typed, you tried to cp resolv.conf onto itself. It doesn't allow me to execute that command because of a missing destination. try

cp   /etc/resolv.conf   ./
from within /tmp. You didn't specify the ./ destination
 
Old 02-05-2005, 10:51 AM   #3
rsteelman
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
My apologies .. ommitted the dot at the end .. meaning the command I typed looks like this

[root@panther tmp]# cp /etc/resolv.conf .

I only use this to demonstrate a point that /tmp directory can't be written and some apps are failing because of this. It should be quite clear that I really don't need to copy resolv.conf to /tmp directory.
 
Old 02-05-2005, 01:12 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
What does "ls -ld /tmp" (no quotes) have to day? I suspect it's permissions problems, in which case, "chown root:root /tmp ; chmod 1777 /tmp" (again no quotes) should set things right again.
 
Old 02-05-2005, 11:03 PM   #5
rsteelman
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Only if it were that simple .. ls -ld /tmp displays following

drwxrwxrwt 8 root root 1024 Jan 31 04:12 /tmp/


I think this is exactly what it should be ..
 
Old 02-06-2005, 12:18 AM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
What does df -i /tmp say?

You may be out of inodes rather than raw disk space.
 
Old 02-06-2005, 10:53 AM   #7
rsteelman
LQ Newbie
 
Registered: Feb 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Interesting point .. but this doesn't seem to be case

df -i /tmp yields following

Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda1 128016 44443 83573 35% /
 
Old 02-06-2005, 07:10 PM   #8
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Well, I honestly don't know what could be the problem. Have you run fsck on the partiion recently? I'd suggest using a live CD if you can. Other than that, I'm fresh out of ideas.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Submount, "permission denied" when writing to floppy as normal user DaneM Linux - Software 5 02-22-2006 02:05 PM
Permission denied writing to ext2 floppy s34n Linux - General 3 02-06-2005 12:20 PM
Why was the relocated /tmp write permission automatically reset (lost)? wirawan0 Mandriva 2 06-26-2004 07:33 PM
original /tmp permission redhatnoob Linux - General 2 11-13-2003 08:05 AM
ls in /tmp produces "permission denied" even as root kpfeiffer Linux - Newbie 5 10-06-2002 12:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration