LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   How can I have: Root has Read-Write, user has read only for the boot filesystem? (http://www.linuxquestions.org/questions/linux-software-2/how-can-i-have-root-has-read-write-user-has-read-only-for-the-boot-filesystem-495627/)

xmrkite 10-25-2006 11:46 PM

How can I have: Root has Read-Write, user has read only for the boot filesystem?
 
Hello. I want to have it so that the user can simply just power off the linux box without there being any problems.

Now I'm new to linux, so correct me if I'm wrong, but I believe I need to do this:

/dev/hda1 - swap partition
/dev/hda2 - linux OS partition (DSL Linux)
/dev/hda3 - User account partition (/home/dsl)

I want /dev/hda2 to be read only and the user "dsl" would be able to save all his stuff to /dev/hda3 aka /home/dsl or something like that.

How can i do it so that when root logs in, he can read and write to the filesystem (install programs, change settings, all that good stuff)?

If this is not possible, what are my options (and how) for making the entire /dev/hda2 partition read-only?

-Thanks

baikonur 10-26-2006 01:32 AM

You can't make the entire hda2 read only. Every user needs write permission in the /tmp directory. In the other directories it's already like you want it to be. At least should be on a sane system. No normal user can do any harm there.

fozner 10-26-2006 04:48 AM

Yeah what he said. You don't need 3 hard drives. Just one will suffice. That way you can use the other ones as alternative operating systems or backups. Permissions are automatically set when you install. When installing DSL to a hard drive, I usually boot the DSL CD in text mode with "dsl 2" and then run "dslinstall." Some people don't like this method but there is obviously more than one way to put a penguin in a box.

Wim Sturkenboom 10-26-2006 09:01 AM

Quote:

Originally Posted by xmrkite
Hello. I want to have it so that the user can simply just power off the linux box without there being any problems.

:confused:

You will always have the risk of loosing information. If acceptable, you can modify the <ctrl><alt><del> combination to shut down the box decently.

xmrkite 10-26-2006 10:00 AM

Hello, thanks for the replys, I think i was a little unclear.

Those 4 partitions are all on the one single hard drive (it's a laptop).

What i need to do is move the /home/dsl and the /temp directories to the third partition, aka hda3.

This way, only the operating system and programs are on hda2

User dsl will not be able to write to hda2, but he will be able to write to hda3.
Please confirm also that i will be able to just power the system down since there is no writing to the hda2 partition.

Where do i make this change?

Wim Sturkenboom 10-26-2006 10:51 AM

You might not write, but I'm quite convinced that the system still does (i.e. logfiles come to mind and probably some other stuff that I'm not familiar with).

The <ctrl><alt><del> change can be made in /etc/inittab.

gcy 10-16-2008 04:31 AM

Keep home on your separate partition. It's easier to back up your data, which is irreplaceable. You can always reinstall an OS, but if the data is lost, so are you.

You cannot make your system files read only; the system will cease to function if you do. It's being written to all the time. The arrangement you first described is the proper, and optimal one.

If you are paranoid about viruses etc install a virus checker and get /etc/cron.hourly to run it every hour.


PS. If your system will only let root shutdown, why not give the user sudo permission to shutdown ?


All times are GMT -5. The time now is 03:19 PM.