Results 1 to 6 of 6
Hi,
Is it possible to mount the /etc directory on a seperate partition? Ideally, I want that partition on a USB pen drive that it in read-only mode.
Thanks....
- 12-21-2005 #1Just Joined!
- Join Date
- Feb 2005
- Posts
- 46
/etc on seperate partition
Hi,
Is it possible to mount the /etc directory on a seperate partition? Ideally, I want that partition on a USB pen drive that it in read-only mode.
Thanks.
- 12-22-2005 #2Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
It's definitely possible, but definitely not easy. It would likely involve hacking the init program to mount /etc before it does anything else, since thats where init reads all its configuration data from. If you don't have a decent knowledge of C and the workings of linux, then I do not recommend attempting this. I'm curious to know, why put /etc on a pen drive?
- 12-22-2005 #3
Taking a stab, I would think that you are trying to prevent your config files from getting edited (by keeping them in RO mode)? As valan said, this would be difficult as to mount, init reads fstab (from /etc). I can suggest, though, that you just have your whole root partition (/) mounted as RO, since nothing really needs to write to it as long as /home, /usr, /var, and /tmp are on separate partitions.
"Time is an illusion. Lunchtime, doubly so."
~Douglas Adams, The Hitchhiker's Guide to the Galaxy
- 12-28-2005 #4Just Joined!
- Join Date
- Feb 2005
- Posts
- 46
Thanks for the replies.
The reason I want a pen drive, is so that if someone ever gets root access, they can simply remount the partition as read-write. I have some pen drives that have a read-only switch on them, and would therefore require the attacker to have physical access to it to make changes to my config.
- 12-29-2005 #5Linux Enthusiast
- Join Date
- Apr 2004
- Location
- UK
- Posts
- 658
initrd
I'm not sure if it's exactly what you are after, but you could use an initrd to do the first few steps of the boot, along with mounting the /etc/ partition on the actual root partition and the perform a pivot_root to switch from the initrd to the actual root partition to complete the boot.
It's not exactly what you are after but you might be able to adapt a similar technique from an encrypted root partition howto.
http://www.ibiblio.org/pub/Linux/doc...tem-HOWTO.html
Check out the link for 'Setting up the boot device'
Of course it is worth noting that if someone gains root access they can patch or replace your programs to look elsewhere for their config files, so a read-only /etc/ isn't a panacea. Something like tripwire would be required to check for changes to the binaries, and the same tool could be used to monitor your config files.
Hope that helps,
Chris...To be good, you must first be bad. "Newbie" is a rank, not a slight.
- 12-30-2005 #6
helpmhost, it's nice that you are security minded, but I don't see this as a good solution for blocking attackers. There are plenty of attacks that can be run without getting rw access to your /etc config files.
If you are really concerned about your environment (and your root account being at risk), you should be looking at other steps to harden your system - SELinux may be what you want to pursue.
This page links to some SELinux resources that may be helpful to you: http://lxer.com/module/newswire/view/50251/index.html


Reply With Quote
