how to mount iso image without root privilege

Hi all:

I know I can use "mdconfig" and "mount" command mount an iso image, but mdconfig need su to become root, so I want know can I mount the image as a normal user?
 
fender0107401 said:
Hi all:

I know I can use "mdconfig" and "mount" command mount an iso image, but mdconfig need su to become root, so I want know can I mount the image as a normal user?

Of course. Learn how to set up sudo on FreeBSD. Add yourself
into the group which is allowed to execute mount command.
Do not forget that in order to mount you have to own device node
of the CD-rom and the mount point (file to which you are mounting).
You also need to allow usermount by editing sysctl.conf.
 
Here is my suggestion for a way to do it that will not compromise your security too much.

1. Write a program that does exactly what you need (mdconfig ...; mount ...). I am attaching such a program to this message.
2, As super user run:
chown root <exec>
chmod 4755 <exec>
This sets the set_uid bit on the file. By doing this you are ensuring that this is the only mount task that can be performed by a non super user.
 
And if you just need to access contents of .iso image, libarchive (read tar) can read iso9660 images.
 
Hi all:

Thanks for the reply.

I use gnome, in gnome use mouse and double click the iso file can display the iso's content. So I think there must have someway mount ios as a normal user. I just want see the content, because I am learning how to produce or tailor a system image, and I like gnome-termial, I need a cli way to see the inside of the image.
 
The port sysutils/fusefs-gnome-vfs will apparently allow you to mount any VFS that gnome understands to a directory - so if Nautilus can browse a CD image, it should also be mountable. I expect it to have the same root/setuid issues as the standard method, but I've never tested it - you might want to take a look.
 
fender0107401 said:
I use gnome, in gnome use mouse and double click the iso file can display the iso's content.
Gnome uses the archive manager to show the contents.
So I think there must have someway mount ios as a normal user.
The archive manager is just an application, it doesn't mount anything.
 
Back
Top