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? |
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. |
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. |
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 |
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 |
Quote:
Here's a short tutorial on editing sudoers using visudo:http://www.go2linux.org/sudoers-how-to Quote:
www.google.com/linux is your friend. Use it to research writing udev rules. There are some good short tutorials on the subject. |
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
|
All times are GMT -5. The time now is 05:50 AM. |