winfsp / sshfs-win

SSHFS For Windows
https://winfsp.dev
Other
4.93k stars 252 forks source link

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

Open HALOCORE opened 3 years ago

HALOCORE commented 3 years ago

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.

HerMajestyDrMona commented 3 years ago

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?

hided62 commented 3 years ago

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.

swvajanyatek commented 3 years ago

Same issue here. Any workarounds?

williammuff commented 3 years ago

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.

hided62 commented 3 years ago

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 hided62@192.168.0.60: /mnt/x

cd /mnt/x && explorer.exe .

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

AtmanActive commented 3 years ago

But it does work perfectly well with WinSCP.

AtmanActive commented 3 years ago

It also works perfectly with Mountainduck (Cyberduck).

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

AtmanActive commented 3 years ago

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.

benoit-roue commented 3 years ago

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)

kazdans commented 2 years ago

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.

operateur404 commented 2 years ago

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.

coderbond commented 2 years ago

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

chowette commented 1 year ago

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

sonofwatt commented 1 year ago

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.

AtmanActive commented 1 year ago

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.

flexjoly commented 1 year ago

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

gelbermeister commented 9 months ago

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 commented 8 months ago

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

fleapower commented 2 weeks ago

I know this is an old thread, but was it ever fixed?