LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2005, 05:01 AM   #1
Menestrel
Member
 
Registered: Oct 2003
Location: Bucharest
Distribution: Debian Sarge, Slackware Current, Ubuntu
Posts: 183

Rep: Reputation: 30
Allow only a user to mount and unmout drives


How can I allow only a certain user to mount and unmount a drive ?
 
Old 07-21-2005, 05:16 AM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
read man mount
 
Old 07-21-2005, 10:28 AM   #3
Menestrel
Member
 
Registered: Oct 2003
Location: Bucharest
Distribution: Debian Sarge, Slackware Current, Ubuntu
Posts: 183

Original Poster
Rep: Reputation: 30
Unhappy I've read it, maybe I'm missing something

If mount a device as root, can I unmount it as a normal user ?
 
Old 07-23-2005, 06:17 AM   #4
bp12345
Member
 
Registered: Jun 2005
Distribution: Debian testing, Kubuntu 5.04
Posts: 104

Rep: Reputation: 15
No. A normal user cannot unmount a drive that root mounted. If it is a linux partition, you can make all directories and files on the drive only accessable by a certain user or group, but not if it is a FAT32 or NTFS one. Perhaps you can make another sub-directory under /mnt or /media (wherever you want to mount it) and set that directory's permissions. Like:

/mnt/user/partition

mount the drive in 'partition' (or whatever you want to call it)
give 'user' permissions so only a specific user or group can access the drive.

I don't know if this will work, but it is worth a try.
 
Old 07-24-2005, 11:54 AM   #5
Menestrel
Member
 
Registered: Oct 2003
Location: Bucharest
Distribution: Debian Sarge, Slackware Current, Ubuntu
Posts: 183

Original Poster
Rep: Reputation: 30
when the computer boots up, it mounts the drives using /etc/fstab, these drives will be root mounted, can I set an option to mount the drives by another user at startup ?
 
Old 07-24-2005, 03:08 PM   #6
bp12345
Member
 
Registered: Jun 2005
Distribution: Debian testing, Kubuntu 5.04
Posts: 104

Rep: Reputation: 15
I don't know of any way to do it. But why would you need to? If you want a drive to be mounted at startup, why would you need to unmount it later?
If you want only a specific user/group to access/write to some files, make subfolder(s) and set the permissions appropritely. This also has the advantage of each user having their own files on one single partition.
 
Old 07-24-2005, 04:01 PM   #7
borromini
Member
 
Registered: Jul 2005
Location: Belgium
Distribution: Zenwalk 2.8
Posts: 35

Rep: Reputation: 15
You can put 'user' between the parameters in the specific fstab line. Like this:
Code:
/dev/hda1    /        reiser4        auto,user,ro        1        1
That way a normal user can mount/umount partitions (or cd's and stuff). Also, when mounted at boot, a user should be able to umount it anyway. So I don't think mounting it as root will prohibit any user from unmounting it with the above option in the fstab - but I'm not 100% sure about that.
 
  


Reply



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
How to give not-root user ability to mount devices to any mount point??? jdupre Linux - General 8 02-04-2012 10:03 AM
mount smb drives as non-root user? cdhgee Linux - Software 5 09-05-2007 07:38 AM
user cant mount after chmod 777 /bin/mount misterwiddle Linux - General 2 04-06-2005 05:36 PM
Give user permission to mount/use cdrom drives or usb drives zwyrbla Linux - Newbie 2 08-23-2004 04:30 PM
mount drives from user instead of root gonavy Linux - Newbie 2 11-29-2003 08:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:04 AM.

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