linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Non-root mount of a FS?
@ 2002-10-28 13:47 Paul Furness
  2002-10-28 14:26 ` Glynn Clements
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Furness @ 2002-10-28 13:47 UTC (permalink / raw)
  To: linux-admin

Good afternoon.

Can anyone help me out with something that's been annoying me for at
least a year? I'm currently using RH 7.3 and Gnome, with Ximian on top,
but I think that is probably not all that relevant to this:

If I log in as me (not root) and I put a CD in, I can mount it by device
like this:

	mount /dev/cdrom

or by mount point like this:

	mount /mnt/cdrom

This all works fine because I have this in my /etc/fstab:

/dev/cdrom      /mnt/cdrom             iso9660 noauto,owner,kudzu,ro 0 0

So far, so good.

I can also do this with a floppy (mount /dev/fd0  or   mount
/mnt/floppy) because I also have this in /etc/fstab:

/dev/fd0        /mnt/floppy            auto     noauto,owner,kudzu 0 0



So I want to do this with another device (in this case a USB Flash HD
which appears as sda1) so I do this:

/dev/sda1       /mnt/ezdrive            vfat    noauto,owner,kudzu 0 0

The problem is that, as root, can do what I want (mount /dev/sda1) and
it works just fine. But if I try this as the user, I get this:

mount: only root can mount /dev/sda1 on /mnt/ezdrive


So it's a permission thing, right? This is where I get lost. "ls -l
/dev/cdrom" shows that it's a pointer to /dev/scd0. "ls -l /dev/scd0
shows that the file is owned by me. If I log into the machine as someone
else, the file is owned by them.
However, /dev/sda1 is persistently owned by root.

So something is changing the ownership of the device files to enable the
user to mount those devices?

What?

How can I set it up to do this for other devices (or even NFS mounts but
not using AMD)? I'm having a real hard time finding any documentation
for this. Oh, and I _don't_ have autofs running.

Somebody must know what's going on...

Thanks

Paul.


-- 
Paul Furness

Systems Manager

Steepness is an illusion caused by flat things leaning over.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Non-root mount of a FS?
  2002-10-28 13:47 Non-root mount of a FS? Paul Furness
@ 2002-10-28 14:26 ` Glynn Clements
  2002-10-28 15:02   ` Paul Furness
  0 siblings, 1 reply; 3+ messages in thread
From: Glynn Clements @ 2002-10-28 14:26 UTC (permalink / raw)
  To: Paul Furness; +Cc: linux-admin


Paul Furness wrote:

> So it's a permission thing, right? This is where I get lost. "ls -l
> /dev/cdrom" shows that it's a pointer to /dev/scd0. "ls -l /dev/scd0
> shows that the file is owned by me. If I log into the machine as someone
> else, the file is owned by them.
> However, /dev/sda1 is persistently owned by root.
> 
> So something is changing the ownership of the device files to enable the
> user to mount those devices?
> 
> What?

AFAICT, the display manager (xdm, gdm, kdm, ...) is configured to use
the pam_console module, which sets the permissions of various devices
as specified by /etc/security/console.perms.

-- 
Glynn Clements <glynn.clements@virgin.net>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Non-root mount of a FS?
  2002-10-28 14:26 ` Glynn Clements
@ 2002-10-28 15:02   ` Paul Furness
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Furness @ 2002-10-28 15:02 UTC (permalink / raw)
  To: linux-admin

Hurrah! That got it! Thanks, Glynn.

Just in case anyone else is trying to get this to work, here's what I
did:

In order for users to mount devices, they need to have perms to the
device file. The display manager knows who's just logged into the
console, and therefore should have rights to change this permissions, 
and it is configured in /etc/security/console.perms (man console.perms
helps here).

Basically, the device you want to make available must have some
appropriate entries in here, and then the ownership of the device files
gets changed when you log in.

To get USB Flash drive to work, the simplest way is to use an already
existing entry in this config file - ie, create a link in /dev to the
device which youre flash drive comes up as (sda1 or sdb1, probably) and
call the link "flash" something (eg flash, flash1 or flash01).

Then create a mount point for it under /mnt which is also called flash*
(/mnt/flash or /mnt/flash1 and so on).

Finally, create an entry in /etc/fstab which maps the device to the
mount point. The easiest is to copy the cdrom or floppy entry, and make
sure it doesn't have "ro" in the options.

Then it works.

Paul.



On Mon, 2002-10-28 at 14:26, Glynn Clements wrote:
> 
> Paul Furness wrote:
> 
> > So it's a permission thing, right? This is where I get lost. "ls -l
> > /dev/cdrom" shows that it's a pointer to /dev/scd0. "ls -l /dev/scd0
> > shows that the file is owned by me. If I log into the machine as someone
> > else, the file is owned by them.
> > However, /dev/sda1 is persistently owned by root.
> > 
> > So something is changing the ownership of the device files to enable the
> > user to mount those devices?
> > 
> > What?
> 
> AFAICT, the display manager (xdm, gdm, kdm, ...) is configured to use
> the pam_console module, which sets the permissions of various devices
> as specified by /etc/security/console.perms.
> 
> -- 
> Glynn Clements <glynn.clements@virgin.net>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
-- 
Paul Furness

Systems Manager

Steepness is an illusion caused by flat things leaning over.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-10-28 15:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-28 13:47 Non-root mount of a FS? Paul Furness
2002-10-28 14:26 ` Glynn Clements
2002-10-28 15:02   ` Paul Furness

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).