Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Oct 23, 2020 · 21 comments

Comments

@HALOCORE
Copy link

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
Copy link

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
Copy link

hided62 commented Jan 17, 2021

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
Copy link

Same issue here. Any workarounds?

@williammuff
Copy link

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
Copy link

hided62 commented Feb 27, 2021

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.

@AtmanActive
Copy link

But it does work perfectly well with WinSCP.

@AtmanActive
Copy link

It also works perfectly with Mountainduck (Cyberduck).

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

@AtmanActive
Copy link

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
Copy link

benoit-roue commented Jul 23, 2021

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
Copy link

kazdans commented Oct 4, 2021

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
Copy link

operateur404 commented Jan 20, 2022

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
Copy link

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

@chowette
Copy link

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
Copy link

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
Copy link

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
Copy link

flexjoly commented Aug 4, 2023

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
Copy link

gelbermeister commented Dec 20, 2023

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
Copy link

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
Copy link

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

@thomax74
Copy link

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

I'm running sshfs-win trying to connect to a drive located on a Windows Server 2019 instance and I'm running into the issue where when I try to rename a file I get the error "You require permission from S-1-5-21-449734894-1124184469-618129862-500 to make changes to this file". SSHFS as a protocol uses SFTP through SSH, I can able to rename files just file through SSH, as well as SFTP, I believe this has to be a bug with the way SSHFS works.

So no, I hope someone does find a fix though

kazdans does have an interesting fix higher in this thread for his NAS:
"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."

Inside my drives recycling $RECYCLING.BIN folder there is a folder called " S-1-5-21-449734894-1124184469-618129862-500", I'm not sure if that's an identifier for the drive itself, but if I can find a way to disable to generate of that file like kazdans did with their NAS, that may solve the problem.

@ibanvaqe
Copy link

Hi,

Any update with this? I cannot rename the files. I can do other actions except that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests