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

net use x: \\sshfs\%username%=user@server password fails on win 7 64 bit #127

Closed
Shaddoh opened this Issue Dec 11, 2017 · 12 comments

Comments

2 participants
@Shaddoh

Shaddoh commented Dec 11, 2017

I have installed winfsp and sshfs-win. I can get win 10 devices working. On any win 7 device I have failed.

net use x: \\sshfs%username%=user@server password
The above returns "system error 67 has occurred."

The below works but does not persist on boot
Open a command prompt.
cd C:\Program Files (x86)\SSHFS-Win\bin
set CYGFUSE=WinFsp
set PATH=C:\Program Files (x86)\SSHFS-Win\bin
sshfs.exe -f -o idmap=user user@server: z:
Gives a RSA authentification error, buit lets you say yes or no to connect.
After this it says service has started and you type in password.

Any help or advice is much appreciated. Thank you


Before submitting this issue please review this checklist. Ideally all checkmarks should be checked upon submitting. (Use an x inside square brackets like so: [x])

  • Issue type: Please consider posting only bug reports or enhancement requests. Questions are better in the WinFsp Google Group.
  • No Duplicate: Ensure that your issue has not been filed before. (Check open and closed issues.)
  • Description: Provide a descriptive title and a detailed explanation of the problem you are experiencing (for a bug report) or you are trying to solve (for an enhancement request).
  • Reproduce: For bug reports provide detailed information on how to reproduce the problem. For enhancement requests you do not need to provide this information, unless you find it relevant.
  • Behaviors: Provide information on the expected and actual behaviors.
  • Environment: For bug reports provide information about your OS version and build (e.g. 10.0.14393) and WinFsp version and build (e.g. 2017.2 or 1.2.17341). For enhancement requests you do not need to provide this information, unless you find it relevant.

@billziss-gh billziss-gh added the bug label Dec 11, 2017

@billziss-gh billziss-gh added this to the v1.3 milestone Dec 11, 2017

@billziss-gh

This comment has been minimized.

Owner

billziss-gh commented Dec 11, 2017

Thank you for reporting this. This is indeed a problem with WinFsp on Windows 7. The problem does not happen on Windows 8 or Windows 10.

As mentioned in billziss-gh/sshfs-win#17: The problem appears to be that the launcher service (WinFsp.Launcher) is unable to launch the SSHFS-Win file system. This is because the CreateProcessW Windows API fails with ERROR_NO_SYSTEM_RESOURCES when launched with EXTENDED_STARTUPINFO_PRESENT. This special invocation of CreateProcessW is used when launching a file system that requires credentials. Normal invocations of CreateProcessW work.

The CreateProcessW failure appears to be an OS bug, but one we must nevertheless find a work around for. The fix will likely be to not use EXTENDED_STARTUPINFO_PRESENT during CreateProcessW on Win7. This fix will appear in v1.3. Given the seriousness of the problem, I might backport this to the release/1.2 branch.

The below works but does not persist on boot
...
sshfs.exe -f -o idmap=user user@server: z:
Gives a RSA authentification error, buit lets you say yes or no to connect.
After this it says service has started and you type in password.

This behavior is by design. The fact that you are able to supply a password and the file system works, proves that the problem is isolated within the launcher.

@billziss-gh billziss-gh modified the milestones: v1.3, v1.2POST1 Dec 11, 2017

@billziss-gh

This comment has been minimized.

Owner

billziss-gh commented Dec 12, 2017

Commit b2e4746 should fix this.

This commit works around the CreateProcessW problem on Win7. Since this is an important problem that makes SSHFS-Win unusable for most on Win7, I am planning to release an update to WinFsp 2017.2 that will include this fix soon.

@Shaddoh

This comment has been minimized.

Shaddoh commented Dec 12, 2017

Thank you very much for working on this. I am new to using this software but it is amazing and have implemented it in several places.

@billziss-gh

This comment has been minimized.

Owner

billziss-gh commented Dec 12, 2017

The latest release is out and should fix this problem. Please try it and let me know.

@Shaddoh

This comment has been minimized.

Shaddoh commented Dec 13, 2017

@billziss-gh

This comment has been minimized.

Owner

billziss-gh commented Dec 13, 2017

I believe you have to use the /persistent:yes option to net use to have the connections persist. Have you tried that?

@Shaddoh

This comment has been minimized.

Shaddoh commented Dec 13, 2017

@billziss-gh

This comment has been minimized.

Owner

billziss-gh commented Dec 13, 2017

@Shaddoh no problem. I am glad it did.

@Shaddoh

This comment has been minimized.

Shaddoh commented Dec 13, 2017

@Shaddoh

This comment has been minimized.

Shaddoh commented Dec 13, 2017

@billziss-gh

This comment has been minimized.

Owner

billziss-gh commented Dec 14, 2017

net use x : \sshfs\useronpc=useronserver@server password /persistent:yes

This is the above command i am using.
I was copying and pasting from my notes and I forgot to change the useronpc to there local
username, so it was the username from a different computer. And it actually worked when that
username was not on the computer I was running the command. weird.

The important username is the useronserver. This is required by SSHFS to allow authentication.

The useronpc username is not strictly necessary. What it does is allow full access to the file system to the Windows user useronpc. If that user does not exist the file system will still work, but you may get "access denied" errors in some cases.

I recommend not using the useronpc= part if you are using the latest versions of WinFsp and SSHFS-Win. They do a pretty go job at figuring out the right Windows user on their own.

net use x : \\sshfs\useronserver@server password /persistent:yes
@Shaddoh

This comment has been minimized.

Shaddoh commented Jan 4, 2018

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