All Projects → elliotchance → Sshtunnel

elliotchance / Sshtunnel

Licence: mit
🚇 Ultra simple SSH tunnelling for Go programs.

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Labels

Projects that are alternatives of or similar to Sshtunnel

Notebook
我的技术笔记本~
Stars: ✭ 118 (-12.59%)
Mutual labels:  ssh
Awesome Ssh
💻 A curated list of SSH resources.
Stars: ✭ 1,742 (+1190.37%)
Mutual labels:  ssh
Ssh Tunnels
Visual examples and use cases for SSH tunnels
Stars: ✭ 130 (-3.7%)
Mutual labels:  ssh
Next Terminal
Next Terminal是一个轻量级堡垒机系统,易安装,易使用,支持RDP、SSH、VNC、Telnet、Kubernetes协议。
Stars: ✭ 2,354 (+1643.7%)
Mutual labels:  ssh
Mainframer Intellij Plugin
An intellij idea plugin for mainframer project
Stars: ✭ 125 (-7.41%)
Mutual labels:  ssh
Ssh Agent
Docker container for SSH agent forwarding on OSX/Linux
Stars: ✭ 128 (-5.19%)
Mutual labels:  ssh
Ssh Login Alert Telegram
Recieive telegram notfications when user connect to a server
Stars: ✭ 117 (-13.33%)
Mutual labels:  ssh
Adams
UNIX system administration in Common Lisp
Stars: ✭ 135 (+0%)
Mutual labels:  ssh
Sish
HTTP(S)/WS(S)/TCP Tunnels to localhost using only SSH.
Stars: ✭ 2,087 (+1445.93%)
Mutual labels:  ssh
Connectbot
ConnectBot is the first SSH client for Android.
Stars: ✭ 1,763 (+1205.93%)
Mutual labels:  ssh
Getssl
obtain free SSL certificates from letsencrypt ACME server Suitable for automating the process on remote servers.
Stars: ✭ 1,687 (+1149.63%)
Mutual labels:  ssh
Tmux Cssh
ClusterSSH with tmux
Stars: ✭ 123 (-8.89%)
Mutual labels:  ssh
Analogsea
Digital Ocean R client
Stars: ✭ 128 (-5.19%)
Mutual labels:  ssh
Nassh Relay
Relay Server for the Secure Shell Chromium plugin
Stars: ✭ 118 (-12.59%)
Mutual labels:  ssh
Sshdeploy
A command-line tool that enables quick build and run deployments over SSH.
Stars: ✭ 131 (-2.96%)
Mutual labels:  ssh
Xxh
🚀 Bring your favorite shell wherever you go through the ssh.
Stars: ✭ 2,559 (+1795.56%)
Mutual labels:  ssh
Pssh
Parallel SSH Tools
Stars: ✭ 127 (-5.93%)
Mutual labels:  ssh
Generate Ssh Configs
Automatically generate ssh config files for your cloud servers
Stars: ✭ 136 (+0.74%)
Mutual labels:  ssh
Question And Answer Sharing System
本系统是基于微信小程序的问答分享系统,采用微信小程序的形式进行开发,后端采用Java框架开发,用户可以在小程序中进行提问、回答、分享故事、评论、围观以及充值收益等操作,在围观的过程中,用户对于感兴趣的内容可进行打赏与点赞。 对于本系统中的提问与分享,提供免费与付费两种模式,将知识交互的便捷性和信息娱乐的共享性进行结合。
Stars: ✭ 135 (+0%)
Mutual labels:  ssh
Sshr
Proxy server for routing SSH connections
Stars: ✭ 129 (-4.44%)
Mutual labels:  ssh

🚇 sshtunnel

Ultra simple SSH tunnelling for Go programs.

Installation

go get -u github.com/elliotchance/sshtunnel

Or better with dep:

dep ensure -add github.com/elliotchance/sshtunnel

Example

// Setup the tunnel, but do not yet start it yet.
tunnel := sshtunnel.NewSSHTunnel(
   // User and host of tunnel server, it will default to port 22
   // if not specified.
   "[email protected]",

   // Pick ONE of the following authentication methods:
   sshtunnel.PrivateKeyFile("path/to/private/key.pem"), // 1. private key
   ssh.Password("password"),                            // 2. password
   sshtunnel.SSHAgent(),                                // 3. ssh-agent

   // The destination host and port of the actual server.
   "dqrsdfdssdfx.us-east-1.redshift.amazonaws.com:5439",
   
   // The local port you want to bind the remote port to.
   // Specifying "0" will lead to a random port.
   "8443",
)

// You can provide a logger for debugging, or remove this line to
// make it silent.
tunnel.Log = log.New(os.Stdout, "", log.Ldate | log.Lmicroseconds)

// Start the server in the background. You will need to wait a
// small amount of time for it to bind to the localhost port
// before you can start sending connections.
go tunnel.Start()
time.Sleep(100 * time.Millisecond)

// NewSSHTunnel will bind to a random port so that you can have
// multiple SSH tunnels available. The port is available through:
//   tunnel.Local.Port

// You can use any normal Go code to connect to the destination server
// through localhost. You may need to use 127.0.0.1 for some libraries.
//
// Here is an example of connecting to a PostgreSQL server:
conn := fmt.Sprintf("host=127.0.0.1 port=%d username=foo", tunnel.Local.Port)
db, err := sql.Open("postgres", conn)

// ...
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].