We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see ourdocumentation.
There was an error while loading.Please reload this page.
1 parent09b173b commitc2910e1Copy full SHA for c2910e1
agent/agent.go
@@ -424,8 +424,12 @@ func (a *agent) handleSSHSession(session ssh.Session) (retErr error) {
424
returnerr
425
}
426
// Set SSH connection environment variables, from the clients perspective.
427
-srcAddr,srcPort:=addrToSSHEnvAddr(session.RemoteAddr())
428
-dstAddr,dstPort:=addrToSSHEnvAddr(session.LocalAddr())
+// Set SSH connection environment variables (these are also set by OpenSSH
+// and thus expected to be present by SSH clients). Since the agent does
429
+// networking in-memory, trying to provide accurate values here would be
430
+// nonsensical. For now, we hard code these values so that they're present.
431
+srcAddr,srcPort:="0.0.0.0","0"
432
+dstAddr,dstPort:="0.0.0.0","0"
433
cmd.Env=append(cmd.Env,fmt.Sprintf("SSH_CLIENT=%s %s %s",srcAddr,srcPort,dstPort))
434
cmd.Env=append(cmd.Env,fmt.Sprintf("SSH_CONNECTION=%s %s %s %s",srcAddr,srcPort,dstAddr,dstPort))
435