MCPcopy Create free account
hub / github.com/tailscale/tailcat / sshProxyCommand

Function sshProxyCommand

cmd/tailcat/ssh.go:78–84  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

76// client to a tailcat server. The command is run by OpenSSH, so values that
77// can contain shell-special characters must be quoted.
78func 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

Callers 2

clientSSHModeFunction · 0.85

Calls

no outgoing calls

Tested by 1