I've the following issue with sshfs while it doesn't happen when I login using ssh:
root@itek:~# sshfs rpi:/ /media/raspberrypi
root@itek:~# LC_ALL=C.UTF-8 ls -l -a -h /media/raspberrypi/etc/alternatives/rsh
ls: cannot read symbolic link '/media/raspberrypi/etc/alternatives/rsh': Operation not permitted
Hi,
I've the following issue with sshfs while it doesn't happen when I login using ssh:
root@itek:~# sshfs rpi:/ /media/raspberrypi
root@itek:~# LC_ALL=C.UTF-8 ls -l -a -h /media/raspberrypi/etc/ alternatives/rsh
ls: cannot read symbolic link '/media/raspberrypi/etc/alternatives/rsh': Operation not permitted
lrwxrwxrwx 1 root root 12 Nov 27˙ 2019 /media/raspberrypi/etc/ alternatives/rsh
root@itek:~# /bin/fusermount -u /media/raspberrypi/
root@itek:~# ssh rpi
[...]
root@raspberrypi:~# LC_ALL=C.UTF-8 ls -l -a -h /etc/alternatives/rsh lrwxrwxrwx 1 root root 12 Nov 27˙ 2019 /etc/alternatives/rsh -> /usr/ bin/ssh
I pick "/etc/alternatives/rsh" as case test but many symlinks cannot be
read when mounting the filesystem via sshfs. I don't want to use the
option "follow_symlinks":
root@itek:~# sshfs -o follow_symlinks rpi:/ /media/raspberrypi
root@itek:~# LC_ALL=C.UTF-8 ls -l -a -h /media/raspberrypi/etc/ alternatives/rsh
-rwxr-xr-x 1 root root 771K Apr 16 18:19 /media/raspberrypi/etc/ alternatives/rsh
root@itek:~# /bin/fusermount -u /media/raspberrypi/
because sshfs replace the symlink with the pointed file, I just want the symlink be readable. Does anybody know how to accomplish that?
Thank you very much for any hint, kind regards.
I had to add -o no_contain_symlinks to a sshfs mount recently (even if
the symlink containing .. pointed to a file inside the shared
directory). Note that this option might allow access to files outside
the shared directory.
Without the option "follow_symlinks" isn't it the case that sshfs can't follow symlinks at all?
Also note that without the option "transform_symlinks", symlinks to
absolute paths (such as all the ones in/etc/alternatives/) will be
pointing to paths on your source system, not the paths they would
ordinarily point to on the remote system.
I just ran into something like this recently. I sshfs mounted remote directory /home/remote-user locally on /home/local-user/mnt
A symlink in the remote directory pointing at /usr/lib/my-app appeared broken. I assumed this was a result of the symlink pointing outside of
the shared path.
As I only temporarily needed to access it, my quick and dirty fix was to copy the remote small directory /usr/lib/my-app into /home/remote-user/ my-app then I could easily access those files over sshfs. After I was finished, I deleted˙/home/remote-user/my-app
This isn't viable for me, I use sshfs to mount the root filesystem of a device for backup purpose, I cannot deal with copying a directory from /etc to other directory.
| Sysop: | Jacob Catayoc |
|---|---|
| Location: | Pasay City, Metro Manila, Philippines |
| Users: | 4 |
| Nodes: | 4 (0 / 4) |
| Uptime: | 497102:26:34 |
| Calls: | 182 |
| Files: | 744 |
| D/L today: |
65 files (9,837K bytes) |
| Messages: | 73,659 |