How to load environment variables in ssh connect?
It works for me. The ssh connect open an no-interactive shell. So it will load the environment variables for an non-interactive shell if you comment or delete this block codes. Alternatively, you can just put all of your required environment lines code above that line.
Where do I add my SSH path setting?
If the PermitUserEnvironment option is set in the sshd config, you can add your PATH setting to ~/.ssh/environment Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research!
Can a ssh connect open a non interactive shell?
The ssh connect open an no-interactive shell. So it will load the environment variables for an non-interactive shell if you comment or delete this block codes. Alternatively, you can just put all of your required environment lines code above that line. Thanks for contributing an answer to Stack Overflow!
Which is the correct path for SSH in Debian?
Debian enables the ~/.bashrc reading, while e.g. Arch does not. ssh seems to be using the non-interactive mode, so ~/.bashrc should be enough. When having problems like this, I usually add a few echo’s to see what files are being run.
Is it safe to forward env variables over SSH?
So the PATH will be set with the remote value of $HOME. THIS IS A SECURITY RISK Don’t transmit sensitive information like passwords this way because anyone can see environment variables of every process on the same computer. Bit of a hack but if you cannot change the server config for some reason it might work.
How are unescaped variables transmitted to the remote side?
The unescaped variables will be expanded locally and the result transmitted to the remote side. So the PATH will be set with the remote value of $HOME. THIS IS A SECURITY RISK Don’t transmit sensitive information like passwords this way because anyone can see environment variables of every process on the same computer.