Fusermount permission error

I know that this is a quiet old conversation, but as I run in a similar issue on a debian system I must ask if you did ever solve this problem?
It looks to me as it if in fact an issue of systemd’s automount unit.

As long as the automounter unit isn’t started the permissions of the mount target are correct:

ls -l /srv/import/
drwxr-xr-x 2 cs cs 4096 Jun 22 20:23 media

but after the automounter unit is started it shows up in the mount list

mount
...
systemd-1 on /srv/import/media type autofs (rw,relatime,fd=41,pgrp=1,timeout=120,minproto=5,maxproto=5,direct,pipe_ino=414634)

and root is the owner of the mount path:

ls -l /srv/import/
drwxr-xr-x 2 root root 0 Jun 25 08:30 media

At this point the mount unit hasn’t done anything as it wasn’t started yet, but the resulting permission cause the mount unit to fail, as my user has not the permission to mount anything there.

Hi @christian_s, and welcome!

I moved your topic to it’s own, dedicated thread. Please don’t necro-bump. See: Forum Rules - Manjaro


With regards to your mount, all I can offer you is:

and:

And I can tell you the I used those exact tips to set up numerous mounts and automounts on my PC, both local, as well as SSHFS.

autofs is a custom PKGBUILD - it is unsupported.

Without the actual content of your units, it is impossible to comment.

cat /etc/systemd/system/srv-import.mount
cat /etc/systemd/system/srv-import.automount

Further investigating this issue I stumbled across the solution myself. As a reference if someone else has the same problem, one must apply the ExtraOptions in systemd’s .automount unit:

[Unit]
Description=Automount /srv/import/media

[Automount]
Where=/srv/import/media
TimeoutIdleSec=120
ExtraOptions=uid=1000,gid=1000

[Install]
WantedBy=multi-user.target

needless to say that uid and gid have to be adjusted to your own id’s.
This solution presumes that you use systemd .mount and .automount unit files, instead of a mount entry in /etc/fstab as described for example in the archlinux wiki about SSHFS (sorry, I was not allowed to post the link here, so you have to google it).
As the systemd units get auto generated from fstab the issue might depend on the systems version of systemd

See:

When you use sshfs it is recommended to use it as a normal user

Note: It is recommended to run SSHFS as regular user (not as root ). For this to work, the mountpoint must be owned by the user. See mount.fuse(8) § SECURITY for details.
SSHFS - ArchWiki

I read the above as necessary to avoid permission issues.

You still have not provided the details requested to document how you define the mount unit.

Your previous comment seems to suggest the filenames in question is

cat /etc/systemd/system/srv-import-media.{mount,automount}

Other comments seems to indicate you are using an entry in /etc/fstab. Mounting network shares using /etc/fstab may be error prone - especially if you rely on specific $UID as indicated in your above comment.

As is said “Where there is a will, there is a way”…

Until your forum privileges have increased you can post a full URL in this format;

`https://forum.manjaro.org`

Which allows others to copy/paste the URL if they wish.

Regards.


Welcome to the Manjaro community

As a new or infrequent forum user, please take some time to familiarise yourself with Forum requirements, and the many ways to use the forum to your benefit:


Update Announcements

The Update Announcements contain important information and a Known Issues and Solutions section that should generally be checked before posting a request for support.

System Information

While information from *-fetch type apps might be fine for someone wishing to buy your computer, for Support purposes it’s better to ask your system directly; :eyes:

Output of the inxi command with appropriate parameters will achieve this (naturally, formatted according to forum guidelines) and will generally be more useful for those wishing to help:

inxi --filter --verbosity=8

or the short form:

inxi -zv8

Be prepared to provide output from other commands whenever asked. It’s equally important to provide as much actionable information as possible in your first post, rather than simply indicating there is a problem.

Highly Recommended
Required Reading
Technical Resources