[Cygwin] Import User Path Variable in Windows when access with SSH
SSH 로 접속을 했을 때, Cygwin 이 Windows 의 User Path Variable 을 읽어들이지 않고 System Path Variable 만 읽어들인다.
비슷한 경우:
https://superuser.com/questions/547098/does-cygwin-import-user-variables-or-just-system-variables
Does Cygwin import user variables or just system variables?
I can see windows system variables in cygwin with echo $MYVar However, user variables don't seem to work. I'm referring to the variables you set in system properties->advanced->environment varia...
superuser.com
Cygwin Doesn't Register All Environment Variables When Using SSH | smithii.com
When initiating a Cygwin bash session via SSH, Cygwin only registers the environment variables for the SYSTEM account, not for the individual user's account. So I added the following code to the end of my .bashrc file: if [ "$SSH_TTY" ]; then pushd . >/dev
smithii.com
이를 해결하기 위해서는 위의 두번째에서 알려주는 방법을 쓸 수도 있지만,
내 경우에는 에러가 발생했다.
가장 간단한 방법은
SSH로 접속할 때에만 따로 User Path Variables 을 .bashrc 에 추가하는 것이다.
.bashrc 의 맨 아래에 다음과 같이 추가하면 된다.
ex)
if [[ -n "$SSH_TTY" ]]; then
export PATH="$PATH:/cygdrive/c/Users/astrodoo/Anaconda3:/cygdrive/c/Users/astrodoo/Anaconda3/Scripts"
fi