LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-26-2005, 07:59 AM   #1
f0rk
LQ Newbie
 
Registered: Dec 2004
Distribution: Slackware, FreeBSD
Posts: 23

Rep: Reputation: 15
A slight problem with file permissions


Following the advice found on this page: http://members.cox.net/laitcg/new/ss.html offered, I executed a shell script that changes the permissions of certain important files to keep others who may at one time or another break into my PC from writing to them.

It worked good too, because now I can't write to the ones that were chmod 600 even as root. Which is a problem becuase I need to tweak one of them a little bit.

I ought to have tested a non-mission critical file before I did this, but I thought that if the file was rw I'd still be able to edit it as root, but I can't. The file can't be deleted, chmod'd, written to or anything. I'll never do that again.

Is there a way in which to change the file permissions on it so that I can modify it?
 
Old 07-26-2005, 08:38 AM   #2
piete
Member
 
Registered: Apr 2005
Location: Havant, Hampshire, UK
Distribution: Slamd64, Slackware, PS2Linux
Posts: 465

Rep: Reputation: 44
Ah! Erk, that's painful ...

Are you sure that the file owner is root?

Try experimenting with a liveCD - file ownership is based on user ID, so you could tweak it there.

Also, looking at that script: is the chmod'd files that you're having problems with, or the chattr ones? chattr -i might be the way forward ...

Good luck!
- Piete.
 
Old 07-26-2005, 08:45 AM   #3
f0rk
LQ Newbie
 
Registered: Dec 2004
Distribution: Slackware, FreeBSD
Posts: 23

Original Poster
Rep: Reputation: 15
It's the chattr'd ones actuallly ... yeah my lilo.conf and inetd.conf certaily are immutable! I can change it if I boot off a Slack10 CD and try to fix it that way?
 
Old 07-26-2005, 08:56 AM   #4
f0rk
LQ Newbie
 
Registered: Dec 2004
Distribution: Slackware, FreeBSD
Posts: 23

Original Poster
Rep: Reputation: 15
Ah ... I think I figured it out ... this is interesting:

Quote:
A file with the `i' attribute cannot be modified: it cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
found this at: http://linuxreviews.org/man/chattr/

Now, as root I do have the CAP_LINUX_IMMUTABLE capability so, I can change the files back as needed, tweak them and write to them as necessary and then chattr them back again. All I need to do now is read that man page and get the command switches right.

If that plan doesn't work I'll boot off my live Slack CD and try again that way.
 
Old 07-26-2005, 08:57 AM   #5
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
You don't need to boot from a CD to execute chattr -i a file
(exept if you can't boot from hd due to a misconfigured chattred lilo.conf )
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slight problem with Apache Basslord1124 Slackware 5 11-01-2005 02:30 AM
Just a slight problem. Pendu Debian 6 09-10-2005 06:22 PM
file system permissions problem guy24x Linux - Security 8 04-07-2005 06:09 PM
File Permissions Problem sjb142 Linux - Networking 3 12-05-2003 06:25 PM
Slight problem with my TV-Out traku Linux - Newbie 0 10-27-2003 07:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:34 PM.

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