LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 07-20-2009, 12:05 AM   #1
Pestossimo
LQ Newbie
 
Registered: Jul 2005
Location: Evanston, IL
Posts: 7

Rep: Reputation: 0
Setting mount privileges on LFS partition


I have a partition set aside to build my LFS system (/dev/hda1). I'd like to allow the lfs user to mount that partition, but no one else.

My strategy for this was to chown /dev/hda1 to lfs, then set the "owner" option in fstab. This would allow only the owner of /dev/hda1 to mount it. The only problem is that when I rebooted, the owner of /dev/hda1 changed back to root.

Is there a better way to do this, or is there a way to change the owner of the device permanently?
 
Old 07-20-2009, 01:14 AM   #2
karamarisan
Member
 
Registered: Jul 2009
Location: Illinois, US
Distribution: Fedora 11
Posts: 374

Rep: Reputation: 55
I don't have a straight-up answer for you, but here are two things that may help:
1. The reason it changes back is that, in modern Linux, a program called udev recreates device files from boot. If changing the ownership of /dev/hda1 is really the best way to do this, maybe it can be configured to make the file that way. That said...
2. Are you trying to prevent accidental or intentional mounting of this device? If the former is sufficient, a single line in sudoers that won't be hard to figure out (`man sudoers` to start) can allow lfs to mount it without a password. If the latter... well, you're not really going to be able to stop anyone with root from mounting. Anything you could do, they could undo. So, I hope it's accidentally mismounting you're afraid of.

Edit P.S.: NU?

Last edited by karamarisan; 07-20-2009 at 01:22 AM.
 
Old 07-21-2009, 12:38 AM   #3
Pestossimo
LQ Newbie
 
Registered: Jul 2005
Location: Evanston, IL
Posts: 7

Original Poster
Rep: Reputation: 0
I have no intention of trying to prevent root from doing it. I was just hoping to make lfs the only unprivileged user able to mount the partition.

sudo may do the trick, but I'm not sure if sudo can be used in a script. I'd like to make the mount part of lfs's .bash_profile script.

P.S. What about NU?

Edit: Oh, my location. Went there for a year of grad school in '04-'05. Don't spend much time here, so haven't bothered to change it.

Last edited by Pestossimo; 07-21-2009 at 12:39 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
lfs:/mnt/lfs/sources/util-linux-2.12r$ cp -v mount/{,u}mount text-utils/more /tools/b arougen02 Linux From Scratch 5 03-19-2008 01:15 PM
lfs:/mnt/lfs/sources/util-linux-2.12r$ cp -v mount/{,u}mount text-utils/more /tools/b arougen02 Linux - Newbie 2 03-16-2008 11:16 AM
vfat partition does not mount on lfs logicalfuzz Linux From Scratch 1 09-02-2005 11:12 AM
Setting administrator privileges? Clubber Lang Linux - General 0 10-21-2004 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 09:27 PM.

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