Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adrian-lin-1-0-0/go-ssh-tunnel
A simple ssh forward / backward tunnel written in GO
https://github.com/adrian-lin-1-0-0/go-ssh-tunnel
backward forward golang reverse ssh-tunnel
Last synced: about 1 month ago
JSON representation
A simple ssh forward / backward tunnel written in GO
- Host: GitHub
- URL: https://github.com/adrian-lin-1-0-0/go-ssh-tunnel
- Owner: adrian-lin-1-0-0
- Created: 2022-07-06T09:25:17.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-06T11:45:11.000Z (over 2 years ago)
- Last Synced: 2024-06-21T01:22:58.235Z (6 months ago)
- Topics: backward, forward, golang, reverse, ssh-tunnel
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SSH Tunnel
## Cmd
### Quick Start
Install
```
go install -v github.com/adrian-lin-1-0-0/go-ssh-tunnel/cmd/sshtnl@latest
```Usage
```
Usage: ssh tunnel [options]
Common Options:
-h, --help Show this message
-u, ssh username
-p, ssh password
-i, identity file [Absolute Path]
-s, ssh server address (127.0.0.1[:22] )
-t, target address (:80)
-l, local address (:80)
-d, direction ,f or b (forward , backend)
```e.g.
### Forward
with identity file
```
sshtnl -u adrian -i /home/adrian/key/key.pem -s 10.0.0.1 -t :3306 -l :3306
```with password
```
sshtnl -u adrian -p adrian-pwd -s 10.0.0.1 -t :3306 -l :3306
```#### Backward
with identity file
```
sshtnl -u adrian -i /home/adrian/key/key.pem -s 10.0.0.1 -t :3306 -l :3306 -d b
```with password
```
sshtnl -u adrian -p adrian-pwd -s 10.0.0.1 -t :3306 -l :3306 -d b
```## Module
### Quick start
```go
package mainimport (
"github.com/adrian-lin-1-0-0/go-ssh-tunnel/pkg/tunnel"
)func main() {
user := "adrian"
pwd:= "adrian-dev"
keyPath := ""
svrAddr := "10.0.0.1:22"
srcAddr := ":3306"
dstAddr := ":3306"
direction := "f" //f or b (forward or backward)
tunnel.NewTunnel(user, pwd, keyPath, svrAddr, srcAddr, dstAddr, direction)
}
```