You are not logged in.

#1 2018-01-13 20:56:26

OlafLostViking
Member
From: Lost
Registered: 2013-01-30
Posts: 59

how to run systemd.automount as user (for SSHFS)

I want to mount some remote sshfs directories when accessing them (since I'm not always connected to the relevant network). When putting the configuration into /etc/fstab oder system wide .mount and .automount files, it works as intended. Neat :-)

But there are some problems with this approach. It works only if the ssh-key is passwordless, the host is already known in /root/.ssh/authorized_keys and the config to reach the system is nothing special (like jumping via a proxy etc.) or was duplicated into root's /root/.ssh/config. Running the automounter as local user would make use of the user's ssh-agent as well as the user's ~/.ssh/config. And it could work on systems where I don't have root access.

Creating ~/.config/systemd/user/path.mount and ~/.config/systemd/user/path.automount works so far that Systemd tries to mount the folder when I access it on the console. But the mount itself fails because of missing persmissions (which would be true for non-fuse mounts...):

path.automount: Failed to initialize automounter: Operation not permitted
path.automount: Failed with result 'resources'.

So my question now is how to tell Systemd to mount this directory as my local user or, if it is stopped by some other mechanism, allow the user this specific mount (f.ex. with udisks2 or something like that)?

Thanks

Offline

#2 2018-01-13 22:26:07

OlafLostViking
Member
From: Lost
Registered: 2013-01-30
Posts: 59

Re: how to run systemd.automount as user (for SSHFS)

Hints for people coming here via search engines:

While still using system wide systemd-mounts, I managed to use my user's local resources by setting SSH_AUTH_SOCKET as environment variable and providing "ssh\040-F\040/home/user/.ssh/config" as ssh_command option. While the result is basically now what I wanted to achieve, the problem of needing to configure this as root is still valid. On a multi-user system root surely doesn't want to take care of every user's multiple sshfs mounts smile.

So, I'm still searching for a way to do all that as a normal user.

Offline

#3 2018-01-14 09:32:20

seth
Member
Registered: 2012-09-03
Posts: 64,524

Re: how to run systemd.automount as user (for SSHFS)

I've no idea but since users are generally not allowed to mount "random stuff™" this could be a security breach if it worked.

Offline

Board footer

Powered by FluxBB