Skip to content

Command not Found & Proper way to cwd #746

Answered by ronf
ascorbic-acid asked this question in Q&A
Discussion options

You must be logged in to vote

You're on the right track here -- AsyncSSH and other implementations like OpenSSH don't really know or care at all about current working directory on a remote system, at least not when starting a shell or exec session. About the only time the working directory impacts SSH is when running SFTP. If you're running commands, it all comes down to telling the remote shell that's launched to change directory and then execute whatever command you want to run. If things get more complicated, you can always build all of this into a shell script that you place on the remote system and have your SSH command just execute that shell script. That lets you do things like conditionals or other multi-line …

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ascorbic-acid
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@ascorbic-acid
Comment options

@ronf
Comment options

ronf Apr 15, 2025
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants