Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 9683

How to SFTP a symbolic on Windows

$
0
0

I have a SFTP server with a jailed environment by doing:

Subsystem sftp internal-sftpMatch User Jailed_User  ChrootDirectory "C:\SFTP_Jail"  X11Forwarding no    AllowTcpForwarding no   ForceCommand internal-sftp

Now I'd like the user to be able to access / download folders from outside this directory (I dont want to duplicate the folders since its a large folder), and that's how I stumbled upon the "mklink" command which creates a symbolic (Note: hardlink is not possible for directories so im using /D).

Everything works fine and I can see the linked directory in my jailed directory. However when I try to download the files through sftp I ran into this error:

remote open("/test.txt"): Permission deniedDownload of file /copy_from/test.txt to .copy_to/test.txt failed

I searched for some solution and came across this post, which basically says that I'm not able to access any files/folder outside my ChrootDirectory, and the solution is to "mount --bind" the folder.

So my question is:

  1. If I'm unable to access any files/folder outside my ChrootDirectory, how am I able to view the directory and its contents ? I was able to "cd" into the copy_from directory and even "ls" the test.txt through sftp.

  2. Based on the error message, I'm running into a permission issue. However I am logging in as the same user who created the file (I only have one user on my pc), so it does not make sense why I can read the file locally but cant download it remotely since they are both the same user.

  3. If symbolic is not possible, how can i mount --bind on Windows ? Last I check you can't do this on Windows.

Sorry if this question has been asked before, i have been searching for an answer for hours now to no avail.

Thanks in advance.


Viewing all articles
Browse latest Browse all 9683