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 <[email protected]> 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@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 > [email protected] > https://lists.freedesktop.org/mailman/listinfo/systemd-devel >
_______________________________________________ systemd-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/systemd-devel
