LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   fstab question (https://www.linuxquestions.org/questions/linux-newbie-8/fstab-question-758977/)

drjay1627 10-01-2009 08:51 AM

fstab question
 
Hello,

I need help with answering a couple of questions. Yes its a homework.

Question 1:

Some Linux's (e.g. RHEL-5) allow a system administrator to set it up so users can do some mount operations, for example they can set it up so a user could stick a CD into the CDROM drive and then without root
privileges use the mount command to mount it. How can this be done?

My Answer:

In the /etc/fstab file, under <option> tab be "user". If "default" then mount can be done only as root.

** Is this a suitable answer for this question?

Question 2:

For (1) to work, in addition to the setup the sys-admin needs
to do, there needs to be something special about the mount executable
on Linux. This special thing has been demonstrated in class in
relation to something else. What is it? Hint: mount(2) still needs
to be called as the root user even on Linux.

My Answer:

rw,noexec,nosuid,nodev,shortname=winnt,uid=(something)

** something similar to this...

I'm really not sure with the second answer. Actually I'm not sure how to articulate my answer. Much appreciated if someone can point me in the right direction.

Thanks

drjay

cpuobsessed 10-01-2009 08:56 AM

Look on tldp.org, they have documentation on all linux commands. Try "man mount" and "man fstab" if you have a linux or unix system available.

i92guboj 10-01-2009 09:23 AM

Quote:

Originally Posted by drjay1627 (Post 3703543)
Question 2:

For (1) to work, in addition to the setup the sys-admin needs
to do, there needs to be something special about the mount executable
on Linux. This special thing has been demonstrated in class in
relation to something else. What is it? Hint: mount(2) still needs
to be called as the root user even on Linux.

My Answer:

rw,noexec,nosuid,nodev,shortname=winnt,uid=(something)

Note that the question itself gives you an important tip. Whatever you are looking for is a property of the mount executable file (usually /sbin/mount), so you should be looking at the properties of this file, and not in your fstab file ;)

catkin 10-01-2009 09:36 AM

Here's the equivalent line from an ubuntu 8.04 system
Code:

/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
It's the "user" group that does what you are looking for (?).

ongte 10-01-2009 09:51 AM

The 2nd question seems to be talking about setting SUID on /bin/mount.

forrestt 10-01-2009 09:54 AM

This link tells us the following about the fstab options:
user / users / nouser
user permits any user to mount the filesystem. This automatically implies noexec, nosuid, nodev unless overridden. If nouser is specified, only root can mount the filesystem. If users is specified, every user in group users will be able to unmount the volume.

I typically use "users" instead of "user" on a system w/ more than one user (i.e. not my desktop). This way, if one user mounts a CD, logs out, and leaves, another user can unmount it so they can use the CD drive.

HTH

Forrest

SaintDanBert 10-01-2009 12:45 PM

Quote:

Originally Posted by forrestt (Post 3703659)
...
I typically use "users" instead of "user" on a system w/ more than one user (i.e. not my desktop). This way, if one user mounts a CD, logs out, and leaves, another user can unmount it so they can use the CD drive.
...

'user' and 'users' are both keywords when used as mount command options
Code:

mount -o user /some/thing /some/where

mount -o users /some/thing  /some/where

With 'user' any individual uid has permission to mount the file system and the uid that mounted the file system is permitted to unmount it. The same uid does both

With 'users' any individual uid has permission to mount the file system and any individual uid has permission to unmount the file system.
The same uid might do both but do not need to.

The keyword 'group' behaves similar to 'users' but requires that the gid of the mounting or unmounting process match the owner gid of the device.

The keyword 'owner' behaves in a similar way, but only a device owner process may mount or unmount.

~~~ 0;-Dan


All times are GMT -5. The time now is 02:25 PM.