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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-21-2005, 05:01 AM
|
#1
|
|
Member
Registered: Oct 2003
Location: Bucharest
Distribution: Debian Sarge, Slackware Current, Ubuntu
Posts: 183
Rep:
|
Allow only a user to mount and unmout drives
How can I allow only a certain user to mount and unmount a drive ?
|
|
|
|
07-21-2005, 05:16 AM
|
#2
|
|
Senior Member
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073
Rep:
|
read man mount
|
|
|
|
07-21-2005, 10:28 AM
|
#3
|
|
Member
Registered: Oct 2003
Location: Bucharest
Distribution: Debian Sarge, Slackware Current, Ubuntu
Posts: 183
Original Poster
Rep:
|
I've read it, maybe I'm missing something
If mount a device as root, can I unmount it as a normal user ?
|
|
|
|
07-23-2005, 06:17 AM
|
#4
|
|
Member
Registered: Jun 2005
Distribution: Debian testing, Kubuntu 5.04
Posts: 104
Rep:
|
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.
|
|
|
|
07-24-2005, 11:54 AM
|
#5
|
|
Member
Registered: Oct 2003
Location: Bucharest
Distribution: Debian Sarge, Slackware Current, Ubuntu
Posts: 183
Original Poster
Rep:
|
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 ?
|
|
|
|
07-24-2005, 03:08 PM
|
#6
|
|
Member
Registered: Jun 2005
Distribution: Debian testing, Kubuntu 5.04
Posts: 104
Rep:
|
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.
|
|
|
|
07-24-2005, 04:01 PM
|
#7
|
|
Member
Registered: Jul 2005
Location: Belgium
Distribution: Zenwalk 2.8
Posts: 35
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:23 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|