Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

Read-only /

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
12 posts • Page 1 of 1
Author
Message
Eidi
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Thu Sep 02, 2004 2:08 am
Location: Arizona
Contact:
Contact Eidi
Website

Read-only /

  • Quote

Post by Eidi » Tue Feb 21, 2006 8:56 pm

I've been wanting to build a dedicated server box for a while, but I've been thinking about how to secure it. I've read parts of the SELinux handbook, but I don't remember them touching on having a readonly / in the /etc/fstab sections.

On a webserver, all that would need to be written to is various log files and /var for hosting an Email server and WordPress. Possibly config files in /etc too. At least, that's how I understand it. I could put those parts on seperate partitions and have everything else read only. The security benefits are obvious, but am I overlooking something? Am I totally misunderstanding what needs to be written to? Would other things need to be written to besides what I mentioned above?

I'd also like to someday do this with my router box, only log files would be written to as far as I can tell.

I'm sorry if this is a stupid question and has been asked many times before, but it doesn't seem to be too common an idea except for LiveCDs from searching. If I have this totally wrong, please correct me.

Thanks!
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Tue Feb 21, 2006 9:01 pm

Eidi,

/etc must be on the root partition or /etc/fstab cannot be read. The only file in /etc/ that needs to be written is mtab.
Do what embedded systems do, for read only roots. make /etc/fstab a symlink to /proc/mounts.

Don't stray too far from the Linux Filesystem Heirarchy - you will get a box that can't boot.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Mankane
n00b
n00b
Posts: 27
Joined: Sat Mar 22, 2003 6:29 pm

  • Quote

Post by Mankane » Thu Feb 23, 2006 3:38 am

Do what embedded systems do, for read only roots. make /etc/fstab a symlink to /proc/mounts.
Did you mean make /etc/mtab a symlink to /proc/mounts?

Charlie
Top
Eidi
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Thu Sep 02, 2004 2:08 am
Location: Arizona
Contact:
Contact Eidi
Website

  • Quote

Post by Eidi » Thu Feb 23, 2006 4:23 am

So... Hmm... Well, what if I had a /etc/ on the root partition, but it only contained fstab, and then had another /etc/ that mounted over the top of it later on?

I did something like this with my home partition on my main box, kinda. Doesn't seem to have caused any side effects, except I lose some disk space.

Thanks for the info. I may still try something like this, just for added security, assuming it can even work...
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Thu Feb 23, 2006 5:59 pm

Mankane,

Oops, yes!

You will have to mount root rw to add users, change passwords and so on ...
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Eidi
Tux's lil' helper
Tux's lil' helper
Posts: 82
Joined: Thu Sep 02, 2004 2:08 am
Location: Arizona
Contact:
Contact Eidi
Website

  • Quote

Post by Eidi » Fri Feb 24, 2006 8:42 pm

Ok, I'll set it all up first, and then mount it read only.

Thanks for the info guys.
Top
adsmith
Veteran
Veteran
Posts: 1386
Joined: Sun Sep 26, 2004 6:59 pm
Location: NC, USA

  • Quote

Post by adsmith » Wed Mar 01, 2006 1:49 pm

I'm considering doing something similar, though for different reasons.

Does "ln -sf /proc/mounts /etc/mtab" give problems on mounting, or do gentoo's startup scripts deal nicely with the "-n" option on mount?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Wed Mar 01, 2006 8:52 pm

adsmith,

You may get errors about not being able to update /etc/mtab but the mount will still work.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
wildhorse
Apprentice
Apprentice
User avatar
Posts: 185
Joined: Thu Mar 16, 2006 3:59 am
Location: Estados Unidos De América

  • Quote

Post by wildhorse » Sat Apr 08, 2006 2:30 am

Maybe it works, maybe not.

FUSE does not mount a fuse-based file system, if euid is equal 0 (root) and /etc/mtab is not writeable. FUSE simply fails. Neither does FUSE know the option -n. In fact it fails if the option -n is present. It is possible to compile fusermount.c with -DIGNORE_MTAB, but that is not a good option either.

The whole concept of /etc/mtab is legacy. :roll:
Top
broken_chaos
Guru
Guru
Posts: 370
Joined: Wed Jan 18, 2006 7:47 am
Location: Ontario, Canada

  • Quote

Post by broken_chaos » Sat Apr 08, 2006 5:40 am

To avoid problems like that, you could also just link /etc/mtab to somewhere that is rw, instead of directly to /proc/mounts.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56088
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Apr 08, 2006 9:56 am

wildhorse,

Beware of broken_chaoss' suggestion. The 'somewhere' needs to be mounted before /etc/mtab is written, the startup scripts may not do that. Consider the sequence
mount root
write /etc/mtab to say root is mounted - breaks because mtab is not mounted
mount someplace
wite /etc/mtab to say someplace is mounted - woeks
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
wildhorse
Apprentice
Apprentice
User avatar
Posts: 185
Joined: Thu Mar 16, 2006 3:59 am
Location: Estados Unidos De América

  • Quote

Post by wildhorse » Sat Apr 08, 2006 6:22 pm

I have looked into /sbin/rc and the rest of the startup procedure. The whole idea of updating /etc/mtab is DOA.
Top
Post Reply

12 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic