[systemd-devel] systemd.automount issue: Failed to initialize automounter: Operation not permitted

Mantas Mikulėnas grawity at gmail.com
Mon Nov 16 23:25:02 UTC 2020


Automounts themselves are established by a magic kernel-level mount
(specifically they're "autofs" mounts), which requires root privileges.

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).

On Tue, Nov 17, 2020, 00:01 Wolter HV <wolterhv at gmx.de> wrote:

>
>
> Hello,
>
> I'm trying to mount an sshfs share using systemd only, on a user level.
> Unfortunately, I get the following error message on journalctl:
>
>         Failed to initialize automounter: Operation not permitted
>
> I get that error message on journalctl after I try to start my automount
> via the command
>
>         systemctl --user start home-anonymous-mountpoint.automount
>
> Please find the full log and unit files below.
>
> However, if I run instead
>
>         systemctl --user start home-anonymous-mountpoint.mount
>
> then the mount works fine.
>
> This is the detailed log:
>
> --- LOG ---
> [REDACTED] systemd: home-anonymous-mountpoint.automount: Failed to
> initialize automounter: Operation not permitted
> [REDACTED] systemd: home-anonymous-mountpoint.automount: Failed with
> result 'resources'.
>    Subject: Unit failed
>    Defined-By: systemd
>    Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>    The unit UNIT has entered the 'failed' state with result 'resources'.
> [REDACTED] systemd: Failed to set up automount remotelocation at
> remotehost.
>    Subject: A start job for unit UNIT has failed
>    Defined-By: systemd
>    Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
>    A start job for unit UNIT has finished with a failure.
>
>    The job identifier is 272 and the job result is failed.
> --- EOF ---
>
> These are my unit files:
>
> --- ~/.config/systemd/user/home-anonymous-mountpoint.automount ---
> [Unit]
> Description=remotelocation at remotehost
>
> [Automount]
> Where=/home/anonymous/mountpoint
> TimeoutIdleSec=600
>
> [Install]
> WantedBy=default.target
> --- EOF ---
>
> --- ~/.config/systemd/user/home-anonymous-mountpoint.mount ---
> [Mount]
> What=remoteuser at remotehost:/srv/sshfs/remotelocation
> Type=fuse.sshfs
> Options=IdentityFile=/home/anonymous/.ssh/keys/remotehost-remoteuser.id_rsa
> TimeoutSec=10
> --- EOF ---
>
> (Crossing my fingers so this message doesn't get garbled or force-wrapped.)
>
> Regards,
>
> Wolter HV
>
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20201117/412ded82/attachment.htm>


More information about the systemd-devel mailing list