sshfs-win icon indicating copy to clipboard operation
sshfs-win copied to clipboard

Connect to win10: Can read/write, but cannot rename/delete (however, Connect to ubuntu 20.04 using `net use` works well)

Open HALOCORE opened this issue 5 years ago • 22 comments

Thanks for this tool, really helpful!

Working cases

It works fine when I connect to a ubuntu 20.04 machine, using net use X: \\sshfs.kr\union@my_linux_machine. can read/write/modify/delete.

Failed cases

However, when I connect to another win10 machine, I cannot rename files/folders, or delete files/folders. I have 2 win10 machines, and I tried on both sides, not working.

Compare with ubuntu sshfs

Then I try to connect to win10 machine from a ubuntu 18.04 machine using sshfs, works fine, so not win10's problem.

What I have tried

I tried those commands, they have the same problem (can read/write, cannot modify/delete). (my_host is a valid host name):

net use X: \\sshfs.k\workshop@my_host\Desktop
net use X: \\sshfs.kr\workshop@my_host
.\sshfs-win.exe svc \sshfs.k\workshop@my_host X:

I also cleared my PATH variable to contain only sshfs-win's bin:

$Env:Path = "C:\Program Files\SSHFS-Win\bin\;"
.\sshfs-win.exe svc \sshfs.k\workshop@my_host X:

no effect. But if I connect to a linux machine, just net use X: \\sshfs.kr\union@my_linux_machine can work well.

Problem: Cannot rename

image image

Problem: Cannot delete

When I delete a file, it seems it is deleted, but when I refresh, it comes back.

HALOCORE avatar Oct 23 '20 12:10 HALOCORE

Hi. I'm experiencing exactly the same issue. I installed OpenSSH Server on Windows (using Manage Optional Features setting). I can read / create new files with SSHFS-Win, but I am unable to rename / delete existing files (even those that have just been created remotely). With Filezilla SFTP everything works fine (renaming, deleting files).

Could somebody please help us resolve this issue?

HerMajestyDrMona avatar Nov 07 '20 11:11 HerMajestyDrMona

When accessing ssh-server of Windows 10, the set permissions are slightly different from those of Linux. In Linux, file permissions are displayed in the form of -rw-r--r--, while in Windows they are displayed in the form of -rw-******.

In my opinion, the difference in the form of permission notation may cause an error.

hided62 avatar Jan 17 '21 17:01 hided62

Same issue here. Any workarounds?

swvajanyatek avatar Jan 20 '21 20:01 swvajanyatek

I don't even get an error when deleting files; they just don't delete. I wish i knew how to see some sort of log for this tool.

williammuff avatar Jan 27 '21 14:01 williammuff

I think it may not be the fault of sshfs-win.

When I mounted a Win10 OpenSSH session on WSL2 and opened it in Windows Explorer, the behavior was similar.

sudo sshfs -o reconnect,allow_other,follow_symlinks,ServerAliveInterval=15,ServerAliveCountMax=3 [email protected]: /mnt/x

cd /mnt/x && explorer.exe .

The difference is that in the case of WSL2, error 0x80070032 occurs.

hided62 avatar Feb 27 '21 13:02 hided62

But it does work perfectly well with WinSCP.

AtmanActive avatar Mar 31 '21 12:03 AtmanActive

It also works perfectly with Mountainduck (Cyberduck).

So, the fault has to be with SSHFS-Win or WinFsp.

AtmanActive avatar Mar 31 '21 12:03 AtmanActive

Just installed winfsp-1.9.21096 and sshfs-win-3.5.20357-x64 and the problem is still present. Can't delete, can't overwrite.

AtmanActive avatar May 06 '21 21:05 AtmanActive

hi, I think I have the same issue with sshfs-win-3.5.20357-x64 and winfsp-1.9.21096, but the server is a Synology NAS.
I can read/write/create, but when I delete, I get no error message and the file disapears. but when I refresh, it appears again.
On the server side, there is no entry of the delete command in the logs of SFTP. (I have the get entries for the file)

benoit-roue avatar Jul 23 '21 17:07 benoit-roue

Hi, I found solution that works with my synology NAS: -) open your synology nas control panel and disable recycle bin for each shared folder in your synology nas -) open synology file station and in shared folders delete folder named # recycle -) on windows PC dissconnect and connect shared folder or reboot PC, done. Now you can delete files and folders.

kazdans avatar Oct 04 '21 15:10 kazdans

Same issue experienced here (unable to rename / move / delete existing files), when accessing OpenSSH 8.6/Win32 on Windows 10 and Windows Server 2019. Making sshfs-win fully compatible with Win32-OpenSSH would be a great alternative to SMB over VPN, or SMB over QUIC.

operateur404 avatar Jan 20 '22 12:01 operateur404

Bummer deal. This open issue is a complete show stopper for sure.

coderbond avatar Jun 03 '22 12:06 coderbond

Same issue here with sshfs-win-3.7.21011-x64.msi and winfsp-1.12.22339.msi connecting on windows 10 server using OpenSSH-Win64-v8.9.1.0.msi

chowette avatar Dec 13 '22 16:12 chowette

Same issue, Windows 11, winfsp-2.0.23075, sshfs-win-3.5.20357-x64 and sshfs-win-manager-setup-v1.3.1. Can't delete some folders or files. In Windows Explorer they will show as deleted until I refresh. What's really weird is that some random files, that have the same permissions (6774), can be deleted.

sonofwatt avatar Apr 06 '23 15:04 sonofwatt

Just installed winfsp-2.0.23075.msi + sshfs-win-3.5.20357-x64.msi + sshfs-win-manager-setup-v1.3.1.exe on Windows 10 Pro, mounting remote SFTP from XigmaNAS (FreeBSD) and the problem is gone.

Was this issue fixed in the meantime, or is this working correctly now because of XigmaNAS ... remains to be seen.

AtmanActive avatar Apr 27 '23 09:04 AtmanActive

Just installed winfsp-2.0.23075.msi and sshfs-win-3.5.20357-x64.msi. To connect to transip stackstorage.com. It works great. But delete does not work. Moving files gives an error.

And it is slow indeed

flexjoly avatar Aug 04 '23 19:08 flexjoly

I guess something is off with the permission mapping when connecting to a Windows-SSH-server. Checking with "fsptool-x64.exe perm", I get these permissions. Renaming and deleting not working (doesn't matter if SSH user is admin or normal user or file has Public:F permission): O:S-1-5-21-1494907016-3268422637-628650691-1000 G:S-1-5-21-1494907016-3268422637-628650691-513 D:P(A;;0x1f019f;;;S-1-5-21-1494907016-3268422637-628650691-1000) (D;;WP;;;S-1-5-21-1494907016-3268422637-628650691-1000) (A;;0x120088;;;S-1-5-21-1494907016-3268422637-628650691-513) (D;;CCDCLCWPCR;;;S-1-5-21-1494907016-3268422637-628650691-513) (A;;0x1201af;;;WD) (perm=197608:197121:0607)

Permission mapping to a Linux-SSH-server looks less complicated. Renaming and deleting works fine: O:S-1-5-21-1494907016-3268422637-628650691-1000 G:S-1-5-21-1494907016-3268422637-628650691-513 D:P(A;;0x1f01bf;;;S-1-5-21-1494907016-3268422637-628650691-1000) (A;;0x1201af;;;S-1-5-21-1494907016-3268422637-628650691-513) (A;;0x120088;;;WD) (perm=197608:197121:0770)

Is there any way to configure permission mapping on mounting? Mounting with -o umask=0770 seems to get ignored.

gelbermeister avatar Dec 20 '23 14:12 gelbermeister

I did some further testing: With SiriKali I can successfully map permissions. It is also possible to map to a windows group using idap=file,gidfile="[...]". But renaming and deliting files is still not possible. Renaming and deleting folders works fine. So I guess it is no charset error. Trying to delete a file results in "permission missing for S-1-5-21-1494907016-3268422637-628650691-1000" But this user has these permissions. I can even write within existing files or create files.

fsptool perm test.txt: O:S-1-5-21-1494907016-3268422637-628650691-1000 G:S-1-5-21-1494907016-3268422637-628650691-1010 D:P(A;;0x1f01bf;;;S-1-5-21-1494907016-3268422637-628650691-1000) (A;;0x1201af;;;S-1-5-21-1494907016-3268422637-628650691-1010) (A;;0x1201af;;;WD) (perm=197608:197618:0777) icacls test.txt (client side): D:P(A;;0x1f01bf;;;S-1-5-21-1494907016-3268422637-628650691-1000) (A;;0x1201af;;;S-1-5-21-1494907016-3268422637-628650691-1010) (A;;0x1201af;;;WD) icacls test.txt (server side): D:AI(A;ID;FA;;;WD) (A;ID;FA;;;S-1-5-21-3011296620-2040390736-40978713-1109) (A;ID;FA;;;S-1-5-21-3011296620-2040390736-40978713-1114)

fsptool perm testfolder: O:S-1-5-21-1494907016-3268422637-628650691-1000 G:S-1-5-21-1494907016-3268422637-628650691-1010 D:P(A;;FA;;;S-1-5-21-1494907016-3268422637-628650691-1000) (A;;0x1201ef;;;S-1-5-21-1494907016-3268422637-628650691-1010) (A;;0x1201ef;;;WD) (perm=197608:197618:0777) icacls testfolder (client side): D:P(A;;FA;;;S-1-5-21-1494907016-3268422637-628650691-1000) (A;;0x1201ef;;;S-1-5-21-1494907016-3268422637-628650691-1010) (A;;0x1201ef;;;WD) icacls testfolder (server side): D:AI(A;OICIID;FA;;;WD) (A;OICIID;FA;;;S-1-5-21-3011296620-2040390736-40978713-1109) (A;OICIID;FA;;;S-1-5-21-3011296620-2040390736-40978713-1114)

tested mount options: create_file_umask=0000,create_dir_umask=0000,umask=0000,idmap=file,uidfile=path/uid.txt,gidfile=path/gid.txt,StrictHostKeyChecking=no

create_file_umask=0000,create_dir_umask=0000,umask=0000,idmap=user

no options

workaround=rename,from_code=UTF8,to_code=ANSI

workaround=rename,from_code=UTF8,to_code=UTF-16

allow_other,allow_root,use_ino

fsname=ntfs,subtype=ntfs

gelbermeister avatar Dec 22 '23 12:12 gelbermeister