LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   mount_command (https://www.linuxquestions.org/questions/slackware-14/mount_command-494797/)

strycnine 10-23-2006 04:54 AM

mount_command
 
I can't mount anything without being root.
I want to use mount command as a simple user...how can I make mount with simple user?

titopoquito 10-23-2006 05:20 AM

Use "user" and probably also "noauto" as (additional) mount options for that device. Look at "man mount" for implications about using "user".

Broder 10-23-2006 05:24 AM

By default, entries in /etc/fstab are set to nouser. This means only root can mount them. To mount as a regular user you need to edit this file. Login as root, then edit the fourth column of the relevant entry in /etc/fstab to read user instead of nouser. This file is re-read upon startup so after editing you either have to restart to have the amendments take affect or else you can reload fstab with the mount -a command.

oliv 10-23-2006 06:31 AM

Test please ignore
 
Test, please ignore

oliv 10-23-2006 06:32 AM

Quote:

Originally Posted by strycnine
I can't mount anything without being root.
I want to use mount command as a simple user...how can I make mount with simple user?

Quote:

Originally Posted by strycnine
I can't mount anything without being root.
I want to use mount command as a simple user...how can I make mount with simple user?

Normally, ordinary users cannot use the mount command unless a corresponding entry is found on /etc/fstab. For example here is my entry corresponding of my windows partition.

/dev/hda1 /mnt/windows ntfs ro,users,nls=iso8859-15,uid=1000,gid=100,noauto 0 0

(should be on a single line)

ro means "read-only"
users means "ordinary users can mount the filesystem"
nls=... "for the encoding in the filenames"
uid=1000,gid=100 to make the file on the windows partition belonging to me (I have the uid 1000 and the gid 100 corresponding to the group "user"
noauto "Do not mount the filesystem automatically, only when requested"

If you want to mount arbitrary filesystem as an ordinary user, you will have to configure sudo (a good introduction to sudo can be found on: http://www.gentoo.org/doc/en/sudo-guide.xml). But be aware that a clever user having the possibility to issue arbitrary mount command could use it to become root, even if you ensure that a users can only mount a filesystem he owns (a way to do this would be to create a file containing a ext2 filesytem with some of the files in it having the suid and then mount this filesystem)

SCerovec 10-23-2006 12:38 PM

what if system auto-mounts
 
If the volume gets mounted auto-magically, the user could get the data without having to mount the fs at all?

perhaps the hotmnt project from sourceforge.net could be usefull?

raska 10-23-2006 12:43 PM

Quote:

Originally Posted by SCerovec
If the volume gets mounted auto-magically, the user could get the data without having to mount the fs at all?...

I don't think so. Any filesystem must be mounted in order to get access to the device.
Are you aware of what you said there?

simcox1 10-23-2006 02:08 PM

I've changed my fstab entry for /mntcdrom to 'noauto,user,umask=0', and I still can't mount unless root. I've never bothered in the past, but it would be nice.

oliv 10-23-2006 03:01 PM

Quote:

Originally Posted by simcox1
I've changed my fstab entry for /mntcdrom to 'noauto,user,umask=0', and I still can't mount unless root. I've never bothered in the past, but it would be nice.

the option is users not user

simcox1 10-23-2006 04:01 PM

I think it should work with either option. I've tried 'users' as well.

simcox1 10-23-2006 04:53 PM

It does work, but not with the command I used to use. 'mount /mnt/cdrom' is ok, 'mount /dev/cdrom /mnt/cdrom' isn't. Thanks anyway.

SCerovec 10-24-2006 05:07 AM

Don't byte me please :)
 
Quote:

Originally Posted by raska
I don't think so. Any filesystem must be mounted in order to get access to the device.
Are you aware of what you said there?

Yes I'm quite aware,:D I ment without having to mount it >>by him self<<, because the ''auto-magic'' does the actual mount;) .
This did't work very well in the past:tisk: , that is why I wrote an tool by my self (had to go thru the whole nightmare of:study: mounting, scripting, learning, fidling, testing...) and that all because *real* user are lazy typers and hate to type mount /mnt/cdrom any time a new cd is inserted and even more hate to type umount /mnt/cdrom...

You know:
User != Admin
not even for extremly large values of User :)


All times are GMT -5. The time now is 11:10 PM.