I'm trying to connect to a remote server using Golang SSH package, but there's a SOCKS between my workstation and this remote server.
I'm able to connect to the server by simply setting a LD_PRELOAD and LD_LIBRARY_PATH and then running:
$ export LD_PRELOAD="/path/to/lib"
$ export LD_LIBRARY_PATH="/path/to/lib"
$ ssh user@hostname
But when I set these variables within the Go code, it doesn't work:
os.Setenv("LD_PRELOAD", "/path/to/file")
os.Setenv("LD_LIBRARY_PATH", "/path/to/file")
If I set these variables within the Go code and try the following, it works:
ssh := exec.Command("ssh", "hostname")
output, _ := ssh.Output()
fmt.Println(string(output))
The ssh PermitUserEnvironment is set as yes
Is there any way to "force" the Golang SSH to use these environment variables?