Documentation ¶
Overview ¶
Package tunnel facilitate the work with remote machines over ssh tunnels
Index ¶
- func AddSshPubKey(client *ssh.Client, user string, keyName string)
- func DeleteSshPubKey(client *ssh.Client, keyTag string)
- func ExecuteCommands(cleint *ssh.Client, commands []string)
- func FirstClient(user string, KeyName string, address string, port string) *ssh.Client
- func Forward(cleintTarget *ssh.Client, localConn net.Conn, remoteAddress string)
- func GetKnownhostsPrivate(cleint *ssh.Client, user string, signer ssh.Signer, address string, ...)
- func GetKnownhostsPublic(user string, signer ssh.Signer, address string, port string)
- func Harvest(dialAddr string, addr net.Addr, key ssh.PublicKey) error
- func HostKeyCallback(dialAddr string, addr net.Addr, key ssh.PublicKey) error
- func ListenDirect(targetKey string, userTarget string, TargetAddress, localListnerAddr string, ...)
- func ListenOverMiddle(userBastion string, userTarget string, bastionKey string, targetKey string, ...)
- func LocalListner(cleintTarget *ssh.Client, localAddress string, remoteAddress string)
- func Recoverer(maxPanics int, id string, f func())
- func SignLocalKey(KeyName string) ssh.Signer
- func TargetClient(cleint *ssh.Client, user string, KeyName string, address string, port string) *ssh.Client
- func TransferFiles(client *ssh.Client, localDir string, targetDir string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSshPubKey ¶
func ExecuteCommands ¶
ExecuteCommands execute a list of shell commands on the client machine
func FirstClient ¶
FirstClient will create SSH client with remote machine
func Forward ¶
Forward dial to the target client and start io.copy fron local-remote and remote-local
func GetKnownhostsPrivate ¶
func GetKnownhostsPrivate(cleint *ssh.Client, user string, signer ssh.Signer, address string, port string)
GetKnownhostsPrivate will harvest the known hosts from machines that located in private subnets over SSH tunnel
func GetKnownhostsPublic ¶
GetKnownhostsPublic will harvest the known hosts from machines that located in public subnets
func Harvest ¶
Harvest dial to the target machine and add the key from ssh response to the known hosts. It assumes that your known_hosts file has an aws header as a comment, i.e. #AWS
func HostKeyCallback ¶
HostKeyCallback creates a host key callback from the given OpenSSH host key files. It assumes that the file is located at "<home>/.ssh/known_hosts"
func ListenDirect ¶
func ListenDirect(targetKey string, userTarget string, TargetAddress, localListnerAddr string, remoteListnerAddr string)
ListenDirect creates SSH tunnel directly to the remote machine
func ListenOverMiddle ¶
func ListenOverMiddle(userBastion string, userTarget string, bastionKey string, targetKey string, bastionAddress string, TargetAddress, localListnerAddr string, remoteListnerAddr string)
ListenOverMiddle creates SSH tunnel over middle machine
func LocalListner ¶
LocalListner start listner on the local address and call Forward function
func SignLocalKey ¶
SignLocalKey create signatures from private keys under the local path ~/.ssh that verify against a public key.
Types ¶
This section is empty.