<div dir="auto"><div dir="auto">Automounts themselves are established by a magic kernel-level mount (specifically they're "autofs" mounts), which requires root privileges.</div><div dir="auto"><br></div><div dir="auto">Your systemd --user instance runs unprivileged, as your own UID, and doesn't have the privilege to mount autofs (or anything else that isn't FUSE).</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 17, 2020, 00:01 Wolter HV <<a href="mailto:wolterhv@gmx.de">wolterhv@gmx.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
Hello,<br>
<br>
I'm trying to mount an sshfs share using systemd only, on a user level. Unfortunately, I get the following error message on journalctl:<br>
<br>
        Failed to initialize automounter: Operation not permitted<br>
<br>
I get that error message on journalctl after I try to start my automount via the command<br>
<br>
        systemctl --user start home-anonymous-mountpoint.automount<br>
<br>
Please find the full log and unit files below.<br>
<br>
However, if I run instead<br>
<br>
        systemctl --user start home-anonymous-mountpoint.mount<br>
<br>
then the mount works fine.<br>
<br>
This is the detailed log:<br>
<br>
--- LOG ---<br>
[REDACTED] systemd: home-anonymous-mountpoint.automount: Failed to initialize automounter: Operation not permitted<br>
[REDACTED] systemd: home-anonymous-mountpoint.automount: Failed with result 'resources'.<br>
   Subject: Unit failed<br>
   Defined-By: systemd<br>
   Support: <a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
<br>
   The unit UNIT has entered the 'failed' state with result 'resources'.<br>
[REDACTED] systemd: Failed to set up automount remotelocation at remotehost.<br>
   Subject: A start job for unit UNIT has failed<br>
   Defined-By: systemd<br>
   Support: <a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
<br>
   A start job for unit UNIT has finished with a failure.<br>
<br>
   The job identifier is 272 and the job result is failed.<br>
--- EOF ---<br>
<br>
These are my unit files:<br>
<br>
--- ~/.config/systemd/user/home-anonymous-mountpoint.automount ---<br>
[Unit]<br>
Description=remotelocation at remotehost<br>
<br>
[Automount]<br>
Where=/home/anonymous/mountpoint<br>
TimeoutIdleSec=600<br>
<br>
[Install]<br>
WantedBy=default.target<br>
--- EOF ---<br>
<br>
--- ~/.config/systemd/user/home-anonymous-mountpoint.mount ---<br>
[Mount]<br>
What=remoteuser@remotehost:/srv/sshfs/remotelocation<br>
Type=fuse.sshfs<br>
Options=IdentityFile=/home/anonymous/.ssh/keys/remotehost-remoteuser.id_rsa<br>
TimeoutSec=10<br>
--- EOF ---<br>
<br>
(Crossing my fingers so this message doesn't get garbled or force-wrapped.)<br>
<br>
Regards,<br>
<br>
Wolter HV<br>
<br>
<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div>