2

I am testing SFTP file trasfer between servers on Windows. I am using psftp.exe as a SFTP Client and RebexTinySftpServer as SFTP server. I am able to connect to the Rebex server and use get and put to transfer files to and from it but all the files that I send to the server automatically goes into a folder inside the Rebex server folder called "data". I want to change the remote working directory to some other path outside of the path at which the Rebex server is extracted. I tried using CD command to change the remote path but it can only change to sub-folders within the Rebex server data folder. When I try to the following commands:

cd /D:/SFTP_Test
cd /D/SFTP_Test
cd /SFTP_Test
cd \D:\SFTP_Test
cd D:\SFTP_Test

I get the message "no such file or directory". What can I do if I just want to change the remote directory to "D:\SFTP_Test". My Rebex server is extracted at the location "D:\SFTP\RebexTinySftpServerBin-1.0.5"

Edit: I have found the solution to my problem with the help of @Martin Prikryl's post. I opened the config file for Rebex server (D:\SFTP\RebexTinySftpServerBin-1.0.5\RebexTinySftpServer.exe.Config) and changed the value of the following line:

<add key="userRootDir" value="data"/> 

To

<add key="userRootDir" value="D:\"/>

and now I can cd to any path inside my D drive using command cd /SFTP_Test

2
  • What does pwd return after you log in? Jun 22 '18 at 7:12
  • It returns "Remote directory is /"
    – Ghos3t
    Jun 22 '18 at 7:14
3

Your SFTP server is configured to chroot to the "data" folder.

There's most probably nothing that you can do on psftp side to leave the "data" folder.

You have to change the SFTP server configuration.

1
  • 1
    I am currently not allowed to install any software on thi s server so I am looking for a portable SFTP server. I checked the server and it is indeed set the path to the following value: User root dir: D:\SFTP\RebexTinySftpServerBin-1.0.5\data , there is a config file for the server, I will try to modify it.
    – Ghos3t
    Jun 22 '18 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.