ssh/tailssh: add support for agent forwarding.

Updates #3802

Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
Maisem Ali
2022-03-14 13:26:06 -07:00
committed by Maisem Ali
parent 6e86bbcb06
commit 98b45ef12c
3 changed files with 63 additions and 5 deletions

View File

@@ -186,6 +186,10 @@ func (ss *sshSession) launchProcess(ctx context.Context) error {
ss.cmd = cmd
if ss.agentListener != nil {
cmd.Env = append(cmd.Env, fmt.Sprintf("SSH_AUTH_SOCK=%s", ss.agentListener.Addr()))
}
ptyReq, winCh, isPty := ss.Pty()
if !isPty {
ss.logf("starting non-pty command: %+v", cmd.Args)