You are not logged in.
Pages: 1
Topic closed
I tried to setup automount on demand of a sshfs according to the wiki, but every time I try to access it, Nautilus gives me this error:
This location could not be displayed.
Sorry, could not display all the contents of “htpc”: No such device
journalctl -u mnt-htpc.automount -u mnt-htpc.mount
Jul 19 01:56:26 localhost systemd[1]: Set up automount mnt-htpc.automount.
Jul 19 01:56:26 localhost systemd[1]: Starting mnt-htpc.automount.
Jul 19 01:57:03 localhost systemd[1]: mnt-htpc.automount: Got automount request for /mnt/htpc, triggered by 5710 (pool)
Jul 19 01:57:03 localhost systemd[1]: Mounting /mnt/htpc...
Jul 19 01:57:03 localhost systemd[1]: Mounted /mnt/htpc.
Jul 19 01:57:03 localhost mount[5712]: read: Connection reset by peer
Jul 19 01:57:03 localhost systemd[1]: mnt-htpc.mount: Mount process exited, code=exited status=1
Jul 19 01:57:03 localhost systemd[1]: mnt-htpc.mount: Unit entered failed state.
Jul 19 01:57:03 localhost systemd[1]: mnt-htpc.automount: Got automount request for /mnt/htpc, triggered by 5243 (nautilus)
Jul 19 01:57:03 localhost systemd[1]: Mounting /mnt/htpc...
Jul 19 01:57:03 localhost systemd[1]: Mounted /mnt/htpc.
Jul 19 01:57:04 localhost mount[5719]: read: Connection reset by peer
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.mount: Mount process exited, code=exited status=1
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.mount: Unit entered failed state.
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.automount: Got automount request for /mnt/htpc, triggered by 5710 (pool)
Jul 19 01:57:04 localhost systemd[1]: Mounting /mnt/htpc...
Jul 19 01:57:04 localhost systemd[1]: Mounted /mnt/htpc.
Jul 19 01:57:04 localhost mount[5727]: read: Connection reset by peer
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.mount: Mount process exited, code=exited status=1
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.mount: Unit entered failed state.
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.automount: Got automount request for /mnt/htpc, triggered by 5246 (gmain)
Jul 19 01:57:04 localhost systemd[1]: Mounting /mnt/htpc...
Jul 19 01:57:04 localhost systemd[1]: Mounted /mnt/htpc.
Jul 19 01:57:04 localhost mount[5736]: read: Connection reset by peer
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.mount: Mount process exited, code=exited status=1
Jul 19 01:57:04 localhost systemd[1]: mnt-htpc.mount: Unit entered failed state.
ExecMount=/usr/bin/mount jonnathan@192.168.1.150:/home/jonnathan /mnt/htpc -n -t fuse.sshfs -o x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/jonnathan/.ssh/id_rsa,allow_other,reconnect
/etc/fstab
jonnathan@192.168.1.150:/home/jonnathan /mnt/htpc fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/jonnathan/.ssh/id_rsa,allow_other,reconnect 0 0
If I try to execute the ExecMount in a shell, it works successfully, but I get asked for the password to unlock my private key. If I mount using `sshfs jonnathan@192.168.1.150:/home/jonnathan /mnt/htpc` without sudo, I don't even get asked for a password, as gnome-keyring/seahorse is set to unlock my private key on login.
My guess is that the mount command can't ask me for a password because is not running in a terminal so the connection gets reset.
Is that really the problem? if so, how do I instruct the systemd/mount or whatever to use the gnome-keyring?
Offline
This is not really a solution, but you should try to make a passwordless ssh key for your user and your sudo user. That's how you can make sure that your problem is actually the unlocking of the key itself, and not something else.
Offline
I tested with a passwordless key and indeed the password seems to be the problem. anyway, I found a solution. It's ugly but it works (kind of).
first I removed that line from /etc/fstab. then I created these two files:
/etc/systemd/system/mnt-htpc.automount
[Automount]
Where=/mnt/htpc
[Install]
WantedBy=remote-fs.target
/etc/systemd/system/mnt-htpc.mount
[Mount]
What=jonnathan@192.168.1.150:/home/jonnathan
Where=/mnt/htpc
Type=fuse.sshfs
Options=noauto,x-systemd.automount,_netdev,users,idmap=user,IdentityFile=/home/jonnathan/.ssh/id_rsa,allow_other,reconnect
Environment="SSH_AUTH_SOCK=/run/user/1000/keyring/ssh"
then I enabled it.
# systemctl enable mnt-htpc.automount
but now the SSH_AUTH_SOCK variable is randomly unset in my environment, not sure if related.
Offline
I tried get run sshfs last days, too.
I tried it first with fstab, later also with the systemd unit files. The fstab method creates unit files. Check:
systemctl list-unit-files
systemctl list-unit-files --user
Creating the systemd files manually is also ok. I tried both methods and prefer the manual creating unit file.
As I read it from you post, you have already configured an ~/.ssh/authorized_keys file on your server and an ~/.ssh/id_rsa & ~/.ssh/id_rsa.pub on your client.
I had the same issue with the password. Manual mounting in terminal works fine without entering password. But with automount I get errors, not worked at the first tests.
I think you need an known_hosts file in your root directory. Create it by connecting the target-server as root from the client.
1. Open a terminal and become root with su, or connect with sudo.
2. And (for your case) then: ssh Jonnathan@192.168.1.150
This will create the file in /root/.ssh/known_hosts
I have this from chapter 4.3 in https://wiki.archlinux.org/title/SSHFS.
Try then what haven't worked for you.
It would be also interesting it you have same troubles as I have.
- Does it work after reboot
- Monitor the mounting with journalctl -f, or journalctl -u mnt-htpc.automount -u mnt-htpc.mount
- I had the problem after manual umount, that the directory is mounted and umounted in a loop.
- I had a another problem, that the Automount after a fresh reboot only works when I open the desktop icon of the sshfs. When I (after fresh reboot) navigate with thunar to the folder and opened then the sshfs directory, it was not mounted automatic.
Offline
obelisk, watch the age of the threads; this one is nine years old.
Using this opportunity to close this old thread.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline
Pages: 1
Topic closed