LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-26-2010, 05:20 PM   #1
Windows to Linux
Member
 
Registered: Sep 2008
Distribution: Ubuntu LTS
Posts: 57

Rep: Reputation: 16
How to allow any user to mount disks with the mount command


I know how to modify the /etc file to change permissions, but I don't think that it could apply to this:

I'm using my Ubuntu desktop to compile Linux From Scratch onto a Virtual Box disk image. I can make it mountable by using a vdfuse program I downloaded, but then I have to use sudo to mount the actual partition. I do not want to give another account the ability to use sudo.

p.s. does this only happen to certain distros, or is a part of the Linux kernel?
 
Old 11-26-2010, 07:29 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Using Ubuntu has colored your perception of sudo and how widespread the sudo command is given to users.

The permission to use sudo is setup during installation, to give you, the installing user, the ability to sudo. Users created after the installation aren't automatically included in sudo, because the configuration file (/etc/sudoers) is written at installation time.

You may edit the sudoers config file to give limited sudo permissions to individual users. You name the user, and specify which commands that users my use via sudo.
 
Old 11-26-2010, 08:10 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,227

Rep: Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196Reputation: 3196
If a pre-set user can't be selected from a choice in some user management app then you may be able to change file permissions on the mount command.

Usually these distro's offer some way to change user permissions. In some disto's the default user can mount some drives while others it is automatic and others need special permissions added. It may be cryptic in which to select.

By default if you give them the right to be a su in sudoer's they are root and that is not a good choice unless you want them to be full admins.

Last edited by jefro; 11-26-2010 at 08:12 PM.
 
Old 11-27-2010, 09:13 PM   #4
ssenuta
Member
 
Registered: Mar 2006
Location: NYS
Distribution: Mandriva-2006
Posts: 123

Rep: Reputation: 16
The mount command has a the following options:

mount -o user ..allow an ordinary user to mount the file system.
mount -o users ..allow every user to mount and unmount the file system.

You can use the Linux /etc/fstab file to define how a devices get mounted.
Here is an example this kind of fstab entry:

/dev/pktcdvd0 /mnt/pktcdvd udf rw,noatime,noauto,users 0 0
/dev/sdc1 /mnt/pendrive vfat rw,noatime,umask=000,utf8,uid=500,shortname=mixed,flush,noauto,users,exec,suid,dev 0 0
 
1 members found this post helpful.
Old 11-27-2010, 09:53 PM   #5
Windows to Linux
Member
 
Registered: Sep 2008
Distribution: Ubuntu LTS
Posts: 57

Original Poster
Rep: Reputation: 16
First: I KNOW what sudo does, it gives a user full permission to do anything.
Second: Can fstab be applied to a file that is not always existing? It is the first time I have used a program this manner, mounting a VBox disk

I'll assume that restrictions on the mount command are inherent to Linux

P.S. This is the script I am using to mount the file

vdfuse-v80 -f ~/.VirtualBox/HardDisks/LFS.vdi ~/virdisk/mnt
sudo mount -o loop ~/virdisk/mnt/Partition1 ~/virdisk/LFS

vdfuse-80 was created by following the instructions found on:
http://forums.virtualbox.org/viewtopic.php?f=26&t=33355
 
0 members found this post helpful.
Old 11-28-2010, 12:37 PM   #6
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
First: I KNOW what sudo does, it gives a user full permission to do anything.
As I pointed in my first reply, if the /etc/sudoers file is written to allow the user that much permission. The rules in that file can also place limits, i.e. allowing the user to use only certain commands as root.

Here's a short tutorial on editing sudoers using visudo:http://www.go2linux.org/sudoers-how-to

Quote:
Second: Can fstab be applied to a file that is not always existing?
If the file is a mountable file system, then you need to write a udev rule to create a persistent name for the device (as opposed to having a different name each time the device is connected to the system). Once you have a persistent name for the device you can then write an entry in fstab. Be advised that error messages will be generated if the device isn't connected at boot time, but that won't stop the system from booting. You will just have error messages in your logs. So long as you know the error only applies to that device, and the device operates when connected, you can ignore the error messages.

www.google.com/linux is your friend. Use it to research writing udev rules. There are some good short tutorials on the subject.

Last edited by bigrigdriver; 11-28-2010 at 12:50 PM.
 
Old 11-29-2010, 06:21 PM   #7
Windows to Linux
Member
 
Registered: Sep 2008
Distribution: Ubuntu LTS
Posts: 57

Original Poster
Rep: Reputation: 16
I'm afraid I don't follow, bigrigdriver... the fact that you refer to the file as a device gives me the impression that you think the vfs is an actual disk drive
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to mount a Windows shared directory and have mount point be owned by nonroot user Arodef Linux - Software 3 09-14-2009 12:23 AM
Hald-subfs-mount Unmounts Usb Disks Directly After Mount dop SUSE / openSUSE 0 03-16-2006 10:58 AM
how to remove permission for a user for using mount command vineet7kumar Linux - Newbie 1 09-11-2005 05:55 AM
run mount command as user paul_mat Linux - Newbie 1 12-14-2004 06:28 PM
normal user cannot use mount command mrosati Slackware 4 01-05-2004 02:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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