Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting "undeletable" files

Status
Not open for further replies.

AndyBo

MIS
May 6, 1999
698
GB
There was a post recently where someone was unable to alter their <FONT FACE=monospace>inetd.conf</font> file.&nbsp;&nbsp;I've not been able to find the original post, so I'm posting this tip hoping that it's seen by the person who had the problem.<br><br>Anyway, just to prove that as you get older you don't lose it, but it does get harder to find, I had a flash of inspiration (or was it perspiration?&nbsp;&nbsp;probably both :) earlier and remembered the <FONT FACE=monospace>chattr</font> command.<br><br><FONT FACE=monospace>chattr</font> lets you set a filesystem level flag to mark a file as &quot;immutable&quot;.&nbsp;&nbsp;ie, regardless of file permissions, you cannot alter the file.&nbsp;&nbsp;To set the immutable flag:<br><FONT FACE=monospace><br>chattr +i /etc/inetd.conf<br></font><br>And to remove it:<br><FONT FACE=monospace><br>chattr -i /etc/inetd.conf<br></font><br>I can't remember if <FONT FACE=monospace>chattr</font> is part of the base system, or if it's part of a secondary package (possibly exttools?), but as soon as I get a chance to check I'll post back here.<br><br>Hope this helps someone :)
 
For Linux, chattr is part of the E2fsprogs package.&nbsp;&nbsp;According to the man page, as of January, 1999 (E2fsprogs version 1.14), ext2 fs 0.5a does not support the c and u attributes and kernel version 2.0 does not support the A attribute, but they will be added. <p>Octalman<br><a href=mailto: > </a><br><a href= > </a><br>
 
Thanks for the info Octal :)&nbsp;&nbsp;I knew there was an &quot;e&quot; and a &quot;2&quot; in that package name somewhere ;^)
 
<br><font color=red><b>AndyBo:</font></b><br><br>I was the one who posted the original thread on how I was unable to alter the inetd.conf file.<br><br>I just wanted to say...&nbsp;&nbsp;&nbsp;I got your message... and&nbsp;&nbsp;Thank you!!!<br><br>That was exactly what I used to set inetd.conf immutable... but I couldn't remember it it for my life.<br><br><b>Thanks again buddy!</b><br> <p> <br><a href=mailto: > </a><br><a href= > </a><br><i>try not!</i><br>
<i>do... or do not. there is no try!</i>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top