Skip to content

SFTP server always prepends home directory to requests #126

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

Closed
an0t8 opened this issue Feb 24, 2016 · 4 comments
Closed

SFTP server always prepends home directory to requests #126

an0t8 opened this issue Feb 24, 2016 · 4 comments

Comments

@an0t8
Copy link

an0t8 commented Feb 24, 2016

Any time that I try to access a folder or file via sftp, it sticks the home directory in front of the request. I cannot change the home directory in sshd_config, Chroot doesn't seem to work.

Example: I connect and the remote directory is C:/Users/username
I try to change to C:/MyDir: >cd C:/Mydir

The server tries to go to C:/Users/username/C:/Mydir

WinSCP even tries to use fully qualified paths within the home directory, so that clicking on a directory "SubDir" tries to access C:/Users/username/C:/Users/username/SubDir

Have I missed a configuration step or is this a bug?

@quamrulmina
Copy link
Contributor

Please use the latest build. What you describe works and should work in the latest builds. cd C:/Mydir will work in sftp clients. Forward slash directory path like Unix is used in directory naming. Chroot feature does not work in Windows. In Windows sftp server, home directories are set to the user's actual home directories ( like c:/users/username or c:/users/suername.domainname ) . You should also undo your changes in sshd_config for home directory if cd c:/Mydir still does not work in your environment after using the latest build.

@an0t8
Copy link
Author

an0t8 commented Feb 26, 2016

Ok, the 2/25 build fixed the issue.

I still can't get public key authentication working. I saw that public key authentication isn't supported with domain logons yet, but I created a local account just for sftp. I tried generating a key pair with ssh-keygen and through puttygen. Put the public key in the C:\Users\user.ssh\autorized_keys file, and access is always denied.

Also, with the new build on Windows 7, the ssh-lsa install script did not work correclty. "[Microsoft.Win32.RegestryKey] doesn't contain a method named 'OpenBaseKey'" I installed ssh-lsa into my registry manually.

@manojampalam
Copy link
Contributor

key auth now works with domain accounts

@ZakThePotter
Copy link

ZakThePotter commented Aug 17, 2016

What kind of slash or backslash should I use for Chroot path ?
Chroot c:/users/username
Chroot c:\users\username

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

No branches or pull requests

4 participants