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

I'm having an issue from windows explorer, it creates 4 folders instead of one. #250

Closed
zacaro opened this issue Nov 6, 2020 · 9 comments

Comments

@zacaro
Copy link

zacaro commented Nov 6, 2020

Basically, when I press the right mouse button and select create a new folder, nothing seems to happen, but when I hit F5 to refresh I'm getting this result:

New folder
New folder (2)
New folder (3)
New folder (4)

In addition, if I create it from cmd.exe, the result is access denied but the folder is created.
Here is my connection string:

C:>"C:\Program Files\SSHFS-Win\bin\sshfs.exe" [email protected]:/home/hoot/videos Z: -ovolname="xxxx xxxxx" -odebug -ologlevel=debug1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oidmap=user -ouid=-1 -ogid=-1 -oumask=000 -ocreate_umask=000 -omax_readahead=1GB -oallow_other -olarge_read -okernel_cache -ofollow_symlinks -oPreferredAuthentications=publickey -oIdentityFile="C:/xxxxxxx/xxxxxx/id_rsa"

Using this network drive from other software usually gets an Operation not permission error.
SSHFS version 3.5.2

@zacaro
Copy link
Author

zacaro commented Nov 17, 2020

Ok, I'm going to add more info to this because I'm unable to get this working as expected.
I'm trying to mount on a Windows Server 2016 Datacenter against Debian 10 server.
If I create a folder or a file from windows explorer I get the mentioned behavior, if I try to create from Windows cmd I get "Access denied" return message, but the file/folder is created. Let's say, something like echo "hello" > hello.txt results in Access Denied but the file is created (with the desired owner, groups and permissions) but with 0 bytes, so an empty file. Looks like the system first create the file and then tries to append the data, first operation is ok but the second is not.

This is the cacls for the file just created:

Z:\Utilities\test>md hello
Access is denied.

Z:\Utilities\test>cd hello

Z:\Utilities\test\hello>echo "hello" > hello.txt
Access is denied.

Z:\Utilities\test\hello>cacls hello.txt /S
Z:\Utilities\test\hello\hello.txt "D:P(A;;0x1f01bf;;;LA)(A;;0x1201af;;;S-1-5-21-39907115-3303241939-1444413837-513)(A;;0x1201af;;;WD)"

On the server end:

root@server:/home/hoot/videos/Utilities# ls -lah test/
total 12K
drwxr-xr-x 3 hoot hoot 4.0K Nov 17 14:58 .
drwxrwxr-x 6 hoot hoot 4.0K Nov 17 14:58 ..
drwxr-xr-x 2 hoot hoot 4.0K Nov 17 14:59 hello
root@server:/home/hoot/videos/Utilities# ls -lah test/hello/
total 8.0K
drwxr-xr-x 2 hoot hoot 4.0K Nov 17 14:59 .
drwxr-xr-x 3 hoot hoot 4.0K Nov 17 14:58 ..
-rwxr-xr-x 1 hoot hoot    0 Nov 17 14:59 hello.txt
root@server:/home/hoot/videos/Utilities# stat test/hello/hello.txt 
  File: test/hello/hello.txt
  Size: 0         	Blocks: 0          IO Block: 4096   regular empty file
Device: 802h/2050d	Inode: 13634026    Links: 1
Access: (0755/-rwxr-xr-x)  Uid: ( 1002/    hoot)   Gid: ( 1002/    hoot)
Access: 2020-11-17 14:59:07.969275825 +0000
Modify: 2020-11-17 14:59:07.969275825 +0000
Change: 2020-11-17 14:59:07.969275825 +0000
 Birth: -
root@server:/home/hoot/videos/Utilities# 

Now, let's talk about permissions.
This all happens if I try to mount the folder with the Linux owner user (hoot) but if I do that with root, no problem at all. I can create, edit, delete, but the files/folders on the server will be owned by root and it is not a solution for me since this folder is shared among other systems and the owner has to be always hoot with 775 for folders and 664 for files.

Other things that I've noted, if I use the exact same configuration on a Windows 10 machine, none of the mentioned behavior appears, so it will most likely be a problem with Windows Server, but I can't figure out what is the next step for me.

Of course there are some workarounds that I can try like acls on Debian but I want to get this to work smoothly as I can do on Windows 10.

If someone here can give me a helping hand it will be much appreciated.

@zacaro
Copy link
Author

zacaro commented Nov 18, 2020

I have more info, reading thoroughly I found that not all the options are being parsed.
Here is the command executed and what is actually being executed.

C:\Users\Administrator>"C:\Program Files\SSHFS-Win\bin\sshfs.exe" [email protected]:/tmp R: -p4022 -ovolname="Tmp folder" -odebug -ologlevel=debug1 -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oidmap=user -ouid=-1 -ogid=-1 -oumask=000 -ocreate_umask=000 -omax_readahead=1GB -oallow_other -olarge_read -okernel_cache -ofollow_symlinks -oPreferredAuthentications=publickey -oIdentityFile="C:/Users/Administrator/.ssh/id_rsa"
SSHFS version 3.5.2
executing <ssh> <-x> <-a> <-oClearAllForwardings=yes> <-oPort=4022> <-ologlevel=debug1> <-oStrictHostKeyChecking=no> <-oUserKnownHostsFile=/dev/null> <-oPreferredAuthentications=publickey> <-oIdentityFile=C:/Users/Administrator/.ssh/id_rsa> <-2> <[email protected]> <-s> <sftp>
debug1: Connecting to xxxxxxxx.xyz [xxx.xxx.xx.xx] port 4022.

Looks like the idmap, uid and gid options are not being addressed... any clues?

@zacaro zacaro changed the title I having an issue from windows explorer, it creates 4 folders instead of one. I'm having an issue from windows explorer, it creates 4 folders instead of one. Nov 19, 2020
@breisig
Copy link

breisig commented Nov 25, 2020

Yeah, I am still having this issue and no one seems to have an answer/fix for it.

@zacaro
Copy link
Author

zacaro commented Nov 27, 2020

Sadly I gave up. I absolutely discarded this for my projects and also I've recommended others not to use sshfs, it is not ready yet for production purposes.

@zacaro zacaro closed this as completed Nov 27, 2020
@LuizLoyola
Copy link

LuizLoyola commented Mar 22, 2021

Having same issue. Will this be fixed?
This should be reopened, as the problem still exists.

@sgm456
Copy link

sgm456 commented Mar 29, 2021

same problem

@Lissanro
Copy link

This common issue still has no known fixes or workarounds. If anyone can find a solution, it would much appreciated.

@Lissanro
Copy link

After reading this #347, I have impression there are currently no plans to continue actively develop this project. So I had to move on to something better. In case somebody needs sshfs/sftp implementation which just works, I suggest RClone (it is free and open source), check my answer at ServerFault for more details and how to use it: https://serverfault.com/a/1105428/393105.

@athila76
Copy link

solution: winfsp/winfsp#357 (comment)

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

6 participants