Is Mounting a (readable) network share possible without privilege?

I am trying to figure out if it’s possible or not, much seem to indicate it’s not, but it’s old information at times so not sure what still holds or not.

I think it’s an issue in how the kernel works and not how the isolations work (apparmor for example),
which is why it’s just “not possible”.

For my usecase i would like if it was possible to have a container mount (or similar) a network share so it can be accessed, and i don’t need write access if that perhaps might help.

When trying to make it work i just get errors which i couldn’t figure out if i was doing something wrong or not, as sometimes i saw apparmor in the dmesg logs, but it seems to have just been for some other mistakes, the actually “errors” just didn’t show, but i noticed it worked when i made the container privileged so i assume it was just locked down, but would like to know how one can actually tell if that’s the case.

Currently, this is only possible if your filesystem of choice has a FUSE client available.

In theory all networked filesystems could be supported inside a user namespace with some being easier (cephfs), than others (cifs, nfs). But it mostly depends on someone spending the potentially large amount of work to implement the feature in the kernel.

Looking it up and i take it it’s basically using a layer with a driver of sorts that says how data is handled in a certain place.
Which to me sounds just like mount does, except it’s available for in user space?

I find much on it though for my case, but is cifs what FUSE can allow in user space?
i thought it was basically just a client of sorts, and mounting was a hidden layer to simplify it.
but it’s apparently very tied to core parts of the os to achieve this and even needs it.

So in my case where i am somewhat limited to smb, which means cifs,
i need to find a fuse client that supports it?
i am skeptical it exists based on my quick searches,
and in the case it doesn’t what might be alternative options that could achieve similar results.
say we aren’t bound to this network share per see, but an application needs to read and write to a place in the network like it was on a folder in a nutshell (well… i notice i just said network share -_-)

Apparently smbnetfs may do what you want.

1 Like

that seems to be it, i even got it to work just now!
i spent forever with gvfs which i kinda got to work but it was a hacky mess any couldn’t make it work as a service cause of how it treated the user.
From just the quick test this seems so much more promising, thanks!

Excellent, great to hear that it works!
This isn’t a FUSE filesystem I’ve ever used, just found it with some googling and search in the Ubuntu package repository :slight_smile:

Well it works as far as i can tell, can’t say anything on performance though, it’s a bit odd in how you use it as you basically specify the parameters as you access the “mounted folder” rather than saying that the folder is mounted with these parameters.

But nevertheless it works so i am happy:)!