Can I mount a file system image without root permission? Normally I would do:
mount -o loop DISK_IMAGE FOLDER
Without using sudo or setting the suid on mount
, is there any suitable way to do this?
I know I can use fusermount
with some ISO images, but that is pretty limited, even for ISO images, some of my images cannot be mounted, but mount
always works.
Best Answer
You can't mount anything that the administrator hasn't somehow given you permission to mount. Only root can call the
mount
system call. The reason for this is that there are many ways to escalate privileges through mounting, such as mounting something over a system location, making files appear to belong to another user and exploiting a program that relies on file ownership, creating setuid files, or exploiting bugs in filesystem drivers.The
mount
command is setuid root. But if you aren't root, it only lets you mount things that are mentioned infstab
.The
fusermount
command is setuid root. It only lets you mount things through a FUSE driver, and restricts your abilities to provide files with arbitrary ownership or permissions that way (under most setups, all files on a FUSE mount belong to you).Your best bet is to find a FUSE filesystem that's capable of reading your disk image. For ISO 9660 images, try both fuseiso and UMfuse's ISO 9660 support (available under Debian as the
fuseiso9660
package).