Find the answer to your Linux question:
Results 1 to 9 of 9
Like Tree1Likes
  • 1 Post By atreyu
Hello. I'm sure this question has been asked often, but I haven't been able to find a satisfactory answer. I want to be able to loop-mount .iso files (and other ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2009
    Posts
    15

    Mount .iso files (and other stuff) as non root


    Hello. I'm sure this question has been asked often, but I haven't been able to find a satisfactory answer.

    I want to be able to loop-mount .iso files (and other stuff) as my normal (non-root) user. But when I try to do it (command: "mount -o loop my-file.iso /media/iso"), I get the fateful "mount: only root can do that" message.

    Anyone knows how to skip this pickyness of the mount command? But, to save your time and mine, before replying please keep in mind that:

    1.- I don't want to use sudo every time. It's slow and annoying.
    2.- Logically, I can't be editing /etc/fstab for every new .iso file I want to mount.
    3.- I don't want to use any gui program. I want to mount in a console.
    4.- I've tried to make /bin/mount suid root, but it doesn't work
    5.- I've tried to edit the /etc/sudoers file (user ALL = NOPASSWD: /bin/mount), but it doesn't work.

    If possible, I'd love to be able to mount ANYTHING as a normal user, not just an .iso file.

    Thank you.
    Last edited by zogoibi; 05-26-2011 at 09:17 PM.

  2. #2
    Just Joined!
    Join Date
    Mar 2009
    Posts
    95
    well u r moving on the correct line

    try using

    $sudo su
    (su changes user id and makes or makes u a super user)
    $cd /mnt/iso
    (creates the folder where u want to mount the ISO)
    $mount -o loop myfile.iso /mnt/ISO
    (mounts the ISO to specifies destination)

  3. #3
    Just Joined!
    Join Date
    Dec 2011
    Posts
    2

    Lightbulb Try fuseiso

    Quote Originally Posted by antonio_helder2002 View Post
    well u r moving on the correct line

    try using

    $sudo su
    I don't really think, that is really helpfull to set up for the ordinary users.
    But what about fuseIso (sourceforge.net/apps/mediawiki/fuse/index.php?title=FuseIso)?

  4. #4
    Just Joined!
    Join Date
    Jul 2009
    Posts
    15
    Antonio: thanks, but remember my point #1.
    I know I can su, I know I can sudo; I can all the same login as root and disregard a normal user. But what I want to do (supposing it's possible) is much, much simpler: I want to mount something as a simple user. Why can't I?
    Very often, I really, really fail to understand the programmers' minds. I can find no strong reason whatsoever to ban a normal user from mounting an .iso file, or whatever. Why on earth is the mount command so supercilious? That frustrates me.

    Jaleks: Thanks. fuseiso works great.
    And, yet... it's not quite the same.

  5. #5
    Just Joined!
    Join Date
    Dec 2011
    Posts
    2
    Quote Originally Posted by zogoibi View Post
    I can find no strong reason whatsoever to ban a normal user from mounting an .iso file, or whatever.
    I can't neither. I think they are afraid of having users mount an .iso on /var or something - but where would be the problem of checking write permissions, or forcing mounting below the home directory only, for ordinary users. *sigh* In which language mount was written then? Perhaps we should release a patch...

  6. #6
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,532
    An injudicious mount could bork your system. It's a way of making your accept responsibility for doing so
    What do we want?
    Time machines!

    When do we want 'em?
    Doesn't really matter does it!?


    The Fifth Continent

  7. #7
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Allowing anyone to mount anything can also cause security issues.
    If you, a regular user, can mount anything you like, then you can introduce outside software to the system. Or you could easily copy files or documents and smuggle them out.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  8. #8
    Just Joined!
    Join Date
    Jul 2009
    Posts
    15
    Quote Originally Posted by Jaleks View Post
    I can't neither. I think they are afraid of having users mount an .iso on /var or something - but where would be the problem of checking write permissions, or forcing mounting below the home directory only, for ordinary users. *sigh* In which language mount was written then? Perhaps we should release a patch...
    If only I knew how to make a patch!!
    Anyhow, very likely there are options in the Makefile for compiling the program so as to be more permissive, don't you think so?


    Quote Originally Posted by elija View Post
    An injudicious mount could bork your system. It's a way of making your accept responsibility for doing so
    Quote Originally Posted by jayd512 View Post
    Allowing anyone to mount anything can also cause security issues.
    If you, a regular user, can mount anything you like, then you can introduce outside software to the system. Or you could easily copy files or documents and smuggle them out.
    *Sigh*
    This is a very old story: usability versus security. Of course linux "gurus" tend to support programmers' choices. But in a quick google search, I've just found approximately 500 threads addressing the problem. We're facing no small issue.

    IMHO, none of the two argued reasons are strong enough to ban a normal user from such an essential function as mounting an iso image, or the like. This is not Windows. Linux users are supposed to know a bit better what they're doing; at least, those who ever open a console. If they're knowledgable enough to use a console, and to su, then they're dangerous enough to injure their systems in one thousand ways, for example "rm -rf /". However, according to your reasoning, we should perhaps ban a normal user from suing or even sudoing: an injudicious su can "bork" your system and cause security issues. If a root user can mount whatever he wants, he can also introduce outside software and smuggle out documents, etc.

    I rather believe that it's more a matter of some programmers' character, than a security measure.

    Whatever. My question has been already replied: with a ready made mount command, there's no way a normal user can mount. Period. Now, let's move to something else.
    Last edited by zogoibi; 12-30-2011 at 06:04 PM.

  9. #9
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    when i've had to do stuff like this in the past, I wrote a small C prog that took an arbitrary command to run as the first arg to it, and any arguments to that command as additional arguments to the C prog. Then I setuid and setuid 0 in the C prog, compiled it, chowned it to root, chmod 4755 it and i'm golden.

    Wildly insecure, but there it is...
    zogoibi likes this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •