-
According to the docs we can run subcommands based of any command (including ssh), how does passing import sh
myserver = sh.ssh(...)
new_env = os.environ.copy()
new_env["NEW_VAR"] = "1"
myserver.printenv(_env=new_env) Would the environment variable I set actually get passed through the SSH session and become usable when I call printenv or a command, that would require the variable to be set? |
Beta Was this translation helpful? Give feedback.
Answered by
amoffat
Oct 5, 2023
Replies: 1 comment
-
It would be available to the ssh process, and if the ssh process forwards environment variables to the connected server, then yes, but I strongly suspect the ssh process doesn't do that for security reasons. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sla-te
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It would be available to the ssh process, and if the ssh process forwards environment variables to the connected server, then yes, but I strongly suspect the ssh process doesn't do that for security reasons.