sshProxyCommand returns the command passed to OpenSSH to connect the SSH client to a tailcat server. The command is run by OpenSSH, so values that can contain shell-special characters must be quoted.
(exe, keyName, derpMapURL, connBlob, portOrIPPort string)
| 76 | // client to a tailcat server. The command is run by OpenSSH, so values that |
| 77 | // can contain shell-special characters must be quoted. |
| 78 | func sshProxyCommand(exe, keyName, derpMapURL, connBlob, portOrIPPort string) string { |
| 79 | cmd := fmt.Sprintf("%s --key=%q", exe, keyName) |
| 80 | if derpMapURL != tailcat.DefaultDERPMapURL { |
| 81 | cmd += fmt.Sprintf(" --derpmap-url=%q", derpMapURL) |
| 82 | } |
| 83 | return fmt.Sprintf("%s %s %s", cmd, connBlob, portOrIPPort) |
| 84 | } |
| 85 | |
| 86 | // sshDestHost returns the hostname to give the system ssh client as the |
| 87 | // connection destination for a tailcat ConnBlob. It is a short, deterministic |
no outgoing calls