You are not logged in.

#1 2013-07-01 15:33:56

MrTea
Member
From: Trier
Registered: 2010-07-16
Posts: 8

x-systemd.automount and sshfs

I've been using sshfs to access files on my pi for serveral months now. Today i tried to enable automatic mounting with x-systemd.automount, but although a manual mount is still possible, the automatic mount fails constantly with a "no such device" error since i added the additional option in /etc/fstab. Journalctl -f on the pi reveals that the "Connection is closed [preauth]", so I would guess that something is wrong with my client authenticating. But I don't understand how is this possible because I can in fact mount the partition manually. Even if I use the exact command used by systemd (found via ps -fe) with root it prompts me for the password of my key and then it mounts correctly. Shouldn't automount then prompt for my password, when my X starts? Any ideas?

line in /etc/fstab:

 herrzinter-pi.local:/media/mediacrypt /home/herrzinter/Multimedia fuse.sshfs  users,noauto,_netdev,reconnect,x-systemd.automount 0   0

Last edited by MrTea (2013-07-01 15:34:13)


Live long and prosper! \\//_

Offline

#2 2013-07-01 21:26:50

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: x-systemd.automount and sshfs

Can you provide the manual mount for comparison?
Why don't you need a "username@" in fstab in this case?

Offline

#3 2013-07-01 21:55:42

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: x-systemd.automount and sshfs

Strike0 wrote:

Why don't you need a "username@" in fstab in this case?

I assume that it didn't cross the OP's mind that this command is not run as a normal user (his own user).  If using sshfs from the command line, you can run it without specifying the username if it is the same on both machines.  Of course, unless the OP is accessing the remote machine as root, this would not be the case.

Offline

#4 2013-07-02 21:31:15

Strike0
Member
From: Germany
Registered: 2011-09-05
Posts: 1,429

Re: x-systemd.automount and sshfs

Interesting, explicitly that's not even in the sshfs faq. So, the automount set up like in #1 should work if the OP logs in with root locally (which is of course undesirable).

Offline

#5 2013-07-02 21:44:52

MrTea
Member
From: Trier
Registered: 2010-07-16
Posts: 8

Re: x-systemd.automount and sshfs

WonderWoofy is right, until now I always used the automatically generated nautilus entry to mount the remote folder. In this case mount command is executed as <user> and so I don't need to put the additional information in the /etc/fstab. btw i didn't exactly look this up, but I've used this setup for quiet some time now, and I guess, that I forgot the herrzinter@ part once and noted that it worked anyway wink
I now added this and the "IdentityFile=/..." option pointing to a dummy ssh key without passphrase and it then it's working, but I am not to happy with this, as an empty passphare key is not really nice, and also nautilus is showing me duplicated entries... but in genreal I have to look at the setup again I am not sure anymore if the x-systemd.automount option is really such a good idea in my case, as the network setup of my laptop is changing quite often... perhaps a bash script at login, or a custom systemd unit is better suited for my purpose

Thank you all anyway smile


Live long and prosper! \\//_

Offline

#6 2013-07-03 00:03:48

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,130

Re: x-systemd.automount and sshfs

I would be interested to know if you figure out a good way of handling this.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB