Documentation ¶
Overview ¶
@Title SSH隧道管理 @Description $ @Author 55 @Date 2021/11/7
@Title SSH隧道 @Description $ @Author 55 @Date 2021/11/7
Index ¶
- func CloseAllTunnel()
- func Tunnel(host, user, pwd, pkey, remote, local string) (listen string, err error)
- func TunnelByKey(host, user, pkey, remote, local string) (listen string, err error)
- func TunnelByPassword(host, user, pwd, remote, local string) (listen string, err error)
- func TunnelUri(uri, remote, local string) (listen string, err error)
- func TunnelUriByKey(uri, pkey, remote, local string) (listen string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Tunnel ¶
添加隧道转发 host ssh服务器 `地址:端口` user 登录用户名 pwd 登录密码 pkey 密钥文件 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口
func TunnelByKey ¶
密钥格式添加隧道 host ssh服务器 `地址:端口` user 登录用户名 pkey 密钥文件 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口
func TunnelByPassword ¶
账号密码格式添加隧道 host ssh服务器 `地址:端口` user 登录用户名 pwd 登录密码 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口
func TunnelUri ¶
以URI格式添加隧道 uri 格式: ssh://root:123456@192.168.1.55:22 remote 开启隧道的远程主机配置,格式为【IP地址:端口】 local 开启隧道映射到本地的配置,格式为【IP地址:端口】, 若端口为0或空,自动分配50000-59999间的端口 返回本地监听`地址:端口`和错误, 如果 `local != listen`说明自动分配过端口
func TunnelUriByKey ¶
以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.