Mount point Too many levels of symbolic links

I’ve set up an SSH mount point using the tutorial found on this forum:

The status seems fine

~/.ssh >> sudo systemctl status mnt-ed1.automount
● mnt-ed1.automount - Automount SSH Share
Loaded: loaded (/etc/systemd/system/mnt-ed1.automount; enabled; vendor preset: disabled)
Active: active (waiting) since Thu 2020-08-20 21:56:20 WEST; 21s ago
Triggers: ● mnt-ed1.mount
Where: /mnt/ed1

ago 20 21:56:20 nfmsbox systemd[1]: Set up automount Automount SSH Share.
~/.ssh >> sudo systemctl status mnt-ed1.mount
● mnt-ed1.mount - Mount SSH Share
Loaded: loaded (/etc/systemd/system/mnt-ed1.mount; disabled; vendor preset: disabled)
Active: inactive (dead)
TriggeredBy: ● mnt-ed1.automount
Where: /mnt/ed1
What: osmc:/media/ED_1

but when i try to access the folder, it throws the following error:

ls: cannot access ‘/mnt/ed1’: Too many levels of symbolic links

This is the contents of the mount file

~/.ssh >> cat /etc/systemd/system/mnt-ed1.mount [Unit]
Description=Mount SSH Share
#Documentation=man systemd.unit man systemd.mount man systemd.special

[Mount]
Where=/mnt/ed1
What=osmc:/media/ED_1
Type=fuse.sshfs
Options=_netdev,IdentityFile=/home/nfms/.ssh/id_rsa,allow_other,reconnect
TimeoutSec=5

[Install]
WantedBy=multi-user.target

Any help?

The prerequisite of sshfs is sftp - so sftp must be available and running on the remote host.

Depending on your actual situation - to be able to use sshfs - first thing is to test that sftp works.

sftp user@server mountpoint

If his doesn’t connect you need to trouble shoot the sftp service on host - your folder mappings on the host etc.

1 Like

There is no sftp service… it’s part of ssh server. There is maybe config to disable sftp but it’s not by default config i know of.

But yes… you should try to connect first manually to see if all is ok before to mount it.

Sftp is part of SSH protocol, but maybe I’m wrong.
I can mount manually using sshfs, but when setting up the mount point there is always the same message.
I’ve tried setting up new pair of Keys on the server, mounting as root, changed owner of the folder to my account but all fails.

That may be entirely correct - I have not thought of it that way - but if you cannot connect using a sftp client - then since sshfs is based upon the sftp service or sshd - hence the first step to troubleshoot is to verify - is it possible to connect using sftp - a yet simple but very effective remedy :stuck_out_tongue_winking_eye: : .

I’ve managed to connect over sftp.

Hi there, not sure if this will be of help but I encountered this exact same problem on Linux Mint 20.1 as outlined by the original poster. I found this thread while searching for a solution and wanted to post in case it helps others.

The actual solution was hinted at here (link removed because the forum won’t let me post a link. It was on vassox dot com).

The solution was to use the command line to open an ssh connection to the destination as the root user (or use sudo) which prompts to add the host fingerprint to the cache, to which you say yes. having done this once, like magic, the automount will work as expected.

Not sure if this is a “bug” in systemd but it would be awfully nice if the error message was somewhat more useful!