Documentation
¶
Index ¶
Constants ¶
View Source
const ( KnownHostsEnvVar = "SSH_KNOWN_HOSTS" DefaultGitSSHUser = "git" // Default SSH user for Git servers DefaultGitSSHPort = 22 // Default SSH port for Git servers )
View Source
const (
SocketAgentSocketEnvVar = "SSH_AUTH_SOCK"
)
Variables ¶
View Source
var KnownHostsFilePath = filepath.Join(os.TempDir(), "known_hosts")
View Source
var SocketAgentSocketPath = filepath.Join(os.TempDir(), "ssh_agent.sock")
Functions ¶
func AddHostToKnownHosts ¶
AddHostToKnownHosts retrieves the host key and adds it to known_hosts.
func AddKeyToAgent ¶
AddKeyToAgent adds a private key to the SSH agent running at the socket specified.
func CreateKnownHostsFile ¶
func CreateKnownHostsFile() error
CreateKnownHostsFile ensures that the known_hosts file exists and sets the SSH_KNOWN_HOSTS environment variable.
func ExtractHostFromSSHUrl ¶
ExtractHostFromSSHUrl extracts the host/domain from an SSH URL.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.