LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-23-2003, 09:59 AM   #1
sammckee
Member
 
Registered: Aug 2003
Posts: 59

Rep: Reputation: 15
Question Permissions question


Can root always do anything with any file? Is it possible for the root user to lock himself out of a file, unable to access it or change its permissions back?
 
Old 09-23-2003, 10:11 AM   #2
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 60
i had a somewhat similiar question a few months back, but it was related to editing the /etc/passwd file and resetting the roots password....and i thought it was a major flaw, so i asked how can this be avoided and here is the answer i got :
Quote:
There are ways to keep anyone from overwritting current files or even appending to them, one way:
chattr +i
On the file. Root cannot even append to the file if this is applied. You will have to:
chattr -i
To remove that restriction to actually change the files. It's a quick and easy thing to do to:
/etc/passwd
/etc/group
/etc/shadow

Just remember you did it should you choose to. This is obviously un-doable should one gain root access, but this will keep them from gaining root access an easier way.
so i would assume chattr +i would stop the root and anyone else from doing anything to a file, and in turn lock them out...
 
Old 09-23-2003, 10:16 AM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Root will always have permission to change permissions so this should never happen. It is possible to write protect a fiel to the root user but you will be able to change the permissions back.
 
Old 09-23-2003, 10:55 AM   #4
RolledOat
Member
 
Registered: Feb 2003
Location: San Antonio
Distribution: Suse 9.0 Professional
Posts: 843

Rep: Reputation: 30
You can make it so that root can't accidentally delete or update a file, which is what I have done for some files, however, in vi, when I really want to
Esc:w! will override the current permissions.

RO

P.S. But accidentally hosing your system is the #1 reason not to run as root. Well, maybe tied for #1 with security risk if you are on the internet. See Mr Ross' sig, well, don't try that as root unless you really want to re-install your OS or want to see just how long it takes your box to die.
Six simple characters on the command line. Now that is power!
 
  


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
Question about permissions UnforgotteN Linux - Distributions 6 05-18-2005 08:51 PM
Permissions question: what does the Thaidog Linux - General 7 03-29-2005 10:16 PM
Permissions question... phil1076 Linux - General 3 09-03-2003 10:50 AM
Permissions Question? gsmonk Linux - General 3 08-27-2003 03:30 PM
Permissions Question jkraeger Linux - General 1 02-25-2003 10:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:16 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