C#C
C#2y ago
Ares

Cant navigate to different directories in sftp server using SSH.NET

I am trying to make code that will navigate throughout my sftp server using SSH.NET library, and I'm having trouble with the navigation. They have a built in way of changing the current working directory with client.ChangeDirectory, and you can access the directory with client.WorkingDirectory. However, this doesn't seem to do anything at all when I use it. Even though I change the workign directory, and I see the string change, when I do "pwd" in ssh to access the current directory, it is always the root no matter what.

The second method to navigate would be to just use cd in ssh, using cSSH.RunCommand("cd ..."). However, this has the same issue where it doesn't seem to change the directory at all. Not sure why, but none of these methods work. I've been trying for a long time now but cant seem to figure out why. Thanks.
Was this page helpful?