sshconfig

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package sshconfig provides a way to work with the ssh user config file.

Package sshconfig provides a way to work with the ssh user config file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BackupSSHConfig

func BackupSSHConfig(path string) error

BackupSSHConfig backs up any SSH config file that currently exists.

func GetHostInfo

func GetHostInfo(db database.DataStore, hostname, host string) ([]string, error)

GetHostInfo returns the information about a SSH entry.

func ImportConf

func ImportConf(ctx context.Context, db database.DataStore, env env.Environment) error

ImportConf reads in the current $HOME/.ssh/config and stores the contents in the DB.

func WriteConf

func WriteConf(ctx context.Context, db database.DataStore, env env.Environment) error

WriteConf writes out a new SSH config file with information from the DB.

func WriteNewConfig

func WriteNewConfig(db database.DataStore, hostname, path string) error

WriteNewConfig writes out a new SSH user config file.

func WriteToDB

func WriteToDB(db database.DataStore, hostname string, entry *sshcfg.SSHHost) error

WriteToDB writes a host entry to the DB.

Types

type SSHHosts

type SSHHosts []*sshcfg.SSHHost

SSHHosts is a slice of sshconfig.SSHHost.

func Import

func Import(filePath string) (SSHHosts, error)

Import reads in the user's SSH config file from $HOME/.ssh/config and returns it's contents as SSHHosts, or returns an error.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL