© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
19 replies
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
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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

SSH / SFTP Connections
C#CC# / help
7mo ago
❔ SSH.Net library using in C# App question
C#CC# / help
3y ago
SFTP through a proxy server
C#CC# / help
3y ago
SSH.NET hide terminal junk
C#CC# / help
2y ago