首页 > 解决方案 > How to fix path references is ssh?

问题描述

I'm having problems with ssh not referencing the /usr/local/bin directory. I know that a manual export PATH="$PATH:/usr/bin" from remote works, however I was hoping to find a way to do it without manually executing the command every time.

echo $PATH output from remote:
$PATH:$JAVA_HOME/bin:/usr/lib/jvm/jdk-16.0.1/bin

echo $JAVA_HOME output from remote:
/usr/lib/jvm/jdk-16.0.1 -- this is right

The problem seems to be with the $PATH and $JAVA_HOME references not working. Not sure how to fix. Thanks for your help.

Edit: Someone told me that I should also include some information about both PCs, so here it is. Both are windows running debian WSL. Both have zsh installed and the .zshrc has a line that sources /etc/environment, which sets the JAVA_HOME and PATH env vars. the output of the two env echos are what the environment variables are set to in the /etc/environment.

Note: I'm a bit new here so if anyone wants some extra information just comment and I'll try to get it.

标签: sshterminal

解决方案


推荐阅读