PDA

View Full Version : mount - Only root can do that



Lisa
28th February 2009, 01:20 AM
When I try to mount a dvd, I get "only root can do that". I know the root password but it is a hassle to switch to root every time.

How can I give my user the ability to mount a dvd?

Is there a reason that only root can mount by default? Would it not seem logical to let users mount DVD's? I'm not sure why this was done but would like to fix it so that users can mount dvd's (all users)

Lisa

Brian1
28th February 2009, 03:23 AM
There are a few ways. The way I know is through editing the /etc/sudoers file. You will want to use the command visudo to edit the file with. There are many examples you can go by. Im not on linux at the moment for reviewing mine but googled for this.


joe ALL = /bin/mount
user joe enters their password for no password then this one
joe ALL = NOPASSWD: /bin/mount /bin/umount

Brian

scottro
28th February 2009, 03:34 AM
You can also edit fstab. (Using sudoers means you'll still have to type your own password--I'm not sure if your desire here is to not type a password at all, or simply not have to type root's.

A sample might be something like

/dev/dvd /media/dvd auto ro,noauto,user,exec 0 0

(Note that your device names and the directories under /media might be different, that's taken from a different distribution.)

crainey69
28th February 2009, 04:19 AM
excuse me for being silly (if I am) but, when I insert a DVD, it mounts automatically.

Perhaps more info is needed.

Cory

Lisa
28th February 2009, 06:14 AM
It appears that when I put a DVD in it automounts as well but where?
I need access to the mount point. I see some eye candypopup with the DVD title but I'm not sure where it is mounting the darn thing.

When I launch dolphin i can see the contents as well but where is that mounted?

I want it mounted to a specific place every time so I can run a script. If you have any idea where my DVD's are auto mounted, that would be great. I have several DVD devices (sr0, sr1, sr2, sr3).

thanks

L

scottro
28th February 2009, 06:21 AM
It should be under /media, I think. See if you have a /media directory and see what's there.

(My problem is that I use a different sort of window manager, and also don't have anything automounted, so I can't be of really specific help.)

Lisa
28th February 2009, 06:27 AM
I tried the visudo thing and edited the file and could not get it to work. Still says "Only root can do that".

Not sure what is up, but I put in exactly what you gave me and it doesn't work. Also I had to search for visudo because it appears nothing is in roots path like it should be.

Some very common default settings for root would be very nice.

Does everyone in the world everywhere edit roots path to make it work on every machine on every install every time since Redhat 1.0?

marko
28th February 2009, 06:32 AM
I tried the visudo thing and edited the file and could not get it to work. Still says "Only root can do that".

Not sure what is up, but I put in exactly what you gave me and it doesn't work. Also I had to search for visudo because it appears nothing is in roots path like it should be.

Some very common default settings for root would be very nice.

Does everyone in the world everywhere edit roots path to make it work on every machine on every install every time since Redhat 1.0?

When you switch to root using "su" remember to add the dash, it tells su to use the root environment:


su -

marko
28th February 2009, 06:40 AM
There are a few ways. The way I know is through editing the /etc/sudoers file. You will want to use the command visudo to edit the file with. There are many examples you can go by. Im not on linux at the moment for reviewing mine but googled for this.


joe ALL = /bin/mount
user joe enters their password for no password then this one
joe ALL = NOPASSWD: /bin/mount /bin/umount

Brian

In mine I have commas between the commands:

mos ALL=/sbin/shutdown -h now, /sbin/reboot, /sbin/poweroff

I suppose that if you get no complaints even after running "visudo -c" then you're likely using the right syntax

Brian1
1st March 2009, 01:15 AM
Yeah mine actually is too. I was not on my linux when answering.
Could you post the lines you added to /etc/sudeors file to see what you did.

Brian

FedoraGeek
2nd August 2009, 05:00 AM
Hi
I am running Fedora Core 11 and I have the following in my /etc/fstab

/dev/sda5 /mnt/D ntfs ro,exec,user,noauto 0 0

thats my ntfs partition. however, I am unable to

mount /mnt/D
or
mount /dev/sda5

as a normal user. It only works when I do sudo or do it as root. Even on the KDE desktop, when I click the link to mount the device, it says "Only root can do that".

Does this mean that FSTAB is not working properly or am I missing something here? I have done this in earlier versions of fedora also (long back actually) and these options used to allow me to mount my ntfs partition.

Can someone help me please?
Thank you for your time..
Regards,
F.

JEO
2nd August 2009, 06:38 AM
Have a look at the following link which talks about unprivileged users mounting block devices with ntfs-3g:

http://ntfs-3g.org/support.html#unprivileged

In order to get my user to mount ntfs-3g I added my user to the "disk" group, changed the permissions of the mount point to that my user has write access to it, and made the mount.ntfs-3g binary suid.

FedoraGeek
3rd August 2009, 01:03 PM
I don't understand why they're deviating from the standard fstab stuff. It used to be so simple to mount and unmount partitions using fstab entries.

I feel as the distros "try" to become more and more sophisticated, they're deviating from the basic unix philosophy of Keep it simple, stupid.

scottro
3rd August 2009, 01:50 PM
In many cases, this is probably too true. I think that what is happening is that control is being sacrificed for convenience, and and it's also acknowledging that Linux has, in many ways, become mainstream.

In some cases, I think it's a good thing--I much prefer yum, even with dependencies that make me say Oh snap, than getting an rpm, trying to install it, finding it needs another rpm which needs yet another rpm. :)

Sometimes change is real improvement--other times it seems to be just for the sake of change.

mathan
3rd August 2009, 01:54 PM
use sudo command

Todamont
9th December 2015, 09:58 PM
Fedora is turning into SUCH a major dissapointment. I can't even just plug a USB drive into the machine and have it mount any more. External drives should NEVER EVER be mounted as root. This is the goddamn stupidest, CRITICAL BUG I have seen in Fedora yet. Things like this are the exact reason I'm giving up on Fedora as a viable OS.

PatMcLJr
10th December 2015, 05:22 PM
Good point, how can I mount my dvd, usb drive, whatever, as a user like maybe diskuser:diskuser and then I can put myself in the diskuser group to use the mounted devices?

lsatenstein
10th December 2015, 07:08 PM
It appears that when I put a DVD in it automounts as well but where?
I need access to the mount point. I see some eye candypopup with the DVD title but I'm not sure where it is mounting the darn thing.

When I launch dolphin i can see the contents as well but where is that mounted?

I want it mounted to a specific place every time so I can run a script. If you have any idea where my DVD's are auto mounted, that would be great. I have several DVD devices (sr0, sr1, sr2, sr3).

thanks

L

when I do a flashdrive or dvd mount, and I happen to be sudo enabled with NOPASS option, I always find my mounted device at /run/media/username/ if you do issue the ls command, you will see the device name(s).

beaker_
11th December 2015, 12:07 AM
I understand buddy hid the age of this tread by starting a new page but have you noticed:



28th February 2009, 06:14 AM
Lisa Offline
Registered User

Join Date: Feb 2007
Posts: 28
automounting dvd
It appears that when I put a DVD in it automounts as well but where?
I need access to the mount point. I see some eye candypopup with the DVD title but I'm not sure where it is mounting the darn thing.

When I launch dolphin i can see the contents as well but where is that mounted?

I want it mounted to a specific place every time so I can run a script. If you have any idea where my DVD's are auto mounted, that would be great. I have several DVD devices (sr0, sr1, sr2, sr3).

thanks

L

She posted > 6 years ago and toda's probably a bot anyway.

/run/media/username/ is spot on though.

jpollard
11th December 2015, 01:00 AM
When I try to mount a dvd, I get "only root can do that". I know the root password but it is a hassle to switch to root every time.

How can I give my user the ability to mount a dvd?

Is there a reason that only root can mount by default?

yes. Doing so allows a user to mount a filesystem that can grant access to devices (via such things as setuid programs to gain root)


Would it not seem logical to let users mount DVD's? I'm not sure why this was done but would like to fix it so that users can mount dvd's (all users)

Lisa

Not always. It depends on the environment and the level of security required. Mounting DVDs (without limits) allows the mounting of filesystems created external to the systems security - and as before, allows for setuid programs that can be used to take over the system.

Now sudo MAY be able to control this - by limiting how the mount is done (restricting to JUST the dvd, and pre-defining the only options to mount allowed (nosuid, nosgid, nodev, owner UID/GID,...), as well as where things can be mounted (no fair using the /root directory as a mount point to take control of the root account...)

udev rules usually handle this for desktops.... including adding/removing an ACL from the /dev/ dvd device, or USB memory sticks (though there are some weaknesses there too).

jpollard
11th December 2015, 03:16 AM
I didn't notice the date either.

But I though I had canceled the post too. But, ah well.

smr54
11th December 2015, 12:22 PM
Heh. Well, it's useful as it shows progression. First an apparent newcomer says, I want to be able to mount my DVD and have root access. Fedora becomes more and more like Windows and Mac with their assumption that the user is on a single user laptop where yeah, let it all be freely accessible, because if you lose your laptop you're out of luck. Then, people with more computer experience notice this, possibly people who use Fedora to see what they are next going to put into RedHat and say, WHAT???


Sooooo

2009. I want to be able to access everything without changing the password.

2015. Wow, that was a bad idea. Why are you giving root access to everyone?

It would all be fine except that RedHat puts it all into their server system, so a RedHat server starts acting like a single user laptop.

jpollard
11th December 2015, 02:52 PM
Heh. Well, it's useful as it shows progression. First an apparent newcomer says, I want to be able to mount my DVD and have root access. Fedora becomes more and more like Windows and Mac with their assumption that the user is on a single user laptop where yeah, let it all be freely accessible, because if you lose your laptop you're out of luck. Then, people with more computer experience notice this, possibly people who use Fedora to see what they are next going to put into RedHat and say, WHAT???

Sooooo

2009. I want to be able to access everything without changing the password.

2015. Wow, that was a bad idea. Why are you giving root access to everyone?

It would all be fine except that RedHat puts it all into their server system, so a RedHat server starts acting like a single user laptop.

It only acts like a desktop if you install a desktop.

Without the desktop it works like a server. You can even install desktop applications - but without the X server it isn't a desktop - and doesn't act like one.