LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-23-2006, 04:54 AM   #1
strycnine
Member
 
Registered: Jul 2006
Location: Romania
Distribution: Fedora 12
Posts: 160

Rep: Reputation: 31
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?
 
Old 10-23-2006, 05:20 AM   #2
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,646

Rep: Reputation: 147Reputation: 147
Use "user" and probably also "noauto" as (additional) mount options for that device. Look at "man mount" for implications about using "user".
 
Old 10-23-2006, 05:24 AM   #3
Broder
Member
 
Registered: Oct 2006
Location: Santa Barbara, C.A.
Distribution: Mood dependent
Posts: 117

Rep: Reputation: 15
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.
 
Old 10-23-2006, 06:31 AM   #4
oliv
LQ Newbie
 
Registered: Oct 2006
Posts: 22

Rep: Reputation: 15
Test please ignore

Test, please ignore
 
Old 10-23-2006, 06:32 AM   #5
oliv
LQ Newbie
 
Registered: Oct 2006
Posts: 22

Rep: Reputation: 15
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)
 
Old 10-23-2006, 12:38 PM   #6
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,477
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Cool 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?
 
Old 10-23-2006, 12:43 PM   #7
raska
Member
 
Registered: Aug 2004
Location: Aguascalientes, AGS. Mexico.
Distribution: Slackware 13.0 kernel 2.6.29.6
Posts: 816

Rep: Reputation: 31
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?

Last edited by raska; 10-23-2006 at 12:44 PM.
 
Old 10-23-2006, 02:08 PM   #8
simcox1
Member
 
Registered: Mar 2005
Location: UK
Distribution: Slackware
Posts: 794
Blog Entries: 2

Rep: Reputation: 30
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.
 
Old 10-23-2006, 03:01 PM   #9
oliv
LQ Newbie
 
Registered: Oct 2006
Posts: 22

Rep: Reputation: 15
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
 
Old 10-23-2006, 04:01 PM   #10
simcox1
Member
 
Registered: Mar 2005
Location: UK
Distribution: Slackware
Posts: 794
Blog Entries: 2

Rep: Reputation: 30
I think it should work with either option. I've tried 'users' as well.
 
Old 10-23-2006, 04:53 PM   #11
simcox1
Member
 
Registered: Mar 2005
Location: UK
Distribution: Slackware
Posts: 794
Blog Entries: 2

Rep: Reputation: 30
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.
 
Old 10-24-2006, 05:07 AM   #12
SCerovec
Senior Member
 
Registered: Oct 2006
Location: Cp6uja
Distribution: Slackware on x86 and arm
Posts: 2,477
Blog Entries: 2

Rep: Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982Reputation: 982
Cool 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, 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 , that is why I wrote an tool by my self (had to go thru the whole nightmare of 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
 
  


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



LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:44 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