ssht

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

@Title SSH隧道管理 @Description $ @Author 55 @Date 2021/11/7

@Title SSH隧道 @Description $ @Author 55 @Date 2021/11/7

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseAllTunnel

func CloseAllTunnel()

关闭所有隧道

func Tunnel

func Tunnel(host, user, pwd, pkey, remote, local string) (listen string, err error)

添加隧道转发 host ssh服务器 `地址:端口` user 登录用户名 pwd 登录密码 pkey 密钥文件 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口

func TunnelByKey

func TunnelByKey(host, user, pkey, remote, local string) (listen string, err error)

密钥格式添加隧道 host ssh服务器 `地址:端口` user 登录用户名 pkey 密钥文件 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口

func TunnelByPassword

func TunnelByPassword(host, user, pwd, remote, local string) (listen string, err error)

账号密码格式添加隧道 host ssh服务器 `地址:端口` user 登录用户名 pwd 登录密码 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口

func TunnelUri

func TunnelUri(uri, remote, local string) (listen string, err error)

以URI格式添加隧道 uri 格式: ssh://root:123456@192.168.1.55:22 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口

func TunnelUriByKey

func TunnelUriByKey(uri, pkey, remote, local string) (listen string, err error)

以URI格式加密钥认证方式添加隧道 uri 格式: ssh://root:123456@192.168.1.55:22 pkey 密钥文件路径 或 密钥字符串 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口

Types

This section is empty.

Jump to

Keyboard shortcuts

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