easyssh-proxy alternatives and similar packages
Based on the "DevOps Tools" category.
Alternatively, view easyssh-proxy alternatives based on common mentions on social networks and blogs.
-
Moby
A collaborative project for the container ecosystem to assemble container-based systems -
Packer
Packer is a tool for creating identical machine images for multiple platforms from a single source configuration. -
webhook
Tool which allows user to create HTTP endpoints (hooks) that execute commands on the server. -
Boom
Boom is a tiny program that sends some load to a web application. -
Go Metrics
Go port of Coda Hale's Metrics library: https://github.com/codahale/metrics. -
rtop
rtop is an interactive, remote system monitoring tool based on SSH -
script
Making it easy to write shell-like scripts in Go for DevOps and system administration tasks. -
goxc
build tool for Go, with a focus on cross-compiling and packaging. -
StatusOK
Monitor your Website and REST APIs.Get Notified through Slack, E-mail when your server is down or response time is more than expected. -
s3gof3r
A small utility/library optimized for high speed transfer of large objects into and out of Amazon S3. -
Scaleway-cli
Manage BareMetal Servers from Command Line (as easily as with Docker). -
skm
SKM is a simple and powerful SSH Keys Manager, it helps you to manage your multiple SSH keys easily! -
govvv
A “go build” wrapper to easily add version information into Go binaries -
uTask
Automation engine that models and executes business processes declared in yaml. -
cassowary
Modern cross-platform HTTP load-testing tool written in Go. -
gonative
Tool which creates a build of Go that can cross compile to all platforms while still using the Cgo-enabled versions of the stdlib packages. -
metric
Minimal metrics for Go (counter/gauge/histogram). No dependencies. Compatible with expvar. Web UI included. -
dogo
Monitoring changes in the source file and automatically compile and run (restart). -
EasySSH
Golang package for easy remote execution through SSH and SCP downloading. -
lstags
Tool and API to sync Docker images across different registries. -
manssh
manssh is a command line tool for managing your ssh alias config easily. -
gobrew
gobrew lets you easily switch between multiple versions of go.
Scout APM - Leading-edge performance monitoring starting at $39/month
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest. Visit our partner's website for more details.
Do you think we are missing an alternative of easyssh-proxy or a related project?
README
easyssh-proxy
easyssh-proxy provides a simple implementation of some SSH protocol features in Go.
Feature
This project is forked from easyssh but add some features as the following.
- [x] Support plain text of user private key.
- [x] Support key path of user private key.
- [x] Support Timeout for the TCP connection to establish.
- [x] Support SSH ProxyCommand.
+--------+ +----------+ +-----------+
| Laptop | <--> | Jumphost | <--> | FooServer |
+--------+ +----------+ +-----------+
OR
+--------+ +----------+ +-----------+
| Laptop | <--> | Firewall | <--> | FooServer |
+--------+ +----------+ +-----------+
192.168.1.5 121.1.2.3 10.10.29.68
Usage
You can see ssh
, scp
, ProxyCommand
on examples
folder.
ssh
See [example/ssh/ssh.go](./example/ssh/ssh.go)
package main
import (
"fmt"
"time"
"github.com/appleboy/easyssh-proxy"
)
func main() {
// Create MakeConfig instance with remote username, server address and path to private key.
ssh := &easyssh.MakeConfig{
User: "appleboy",
Server: "example.com",
// Optional key or Password without either we try to contact your agent SOCKET
//Password: "password",
// Paste your source content of private key
// Key: `-----BEGIN RSA PRIVATE KEY-----
// MIIEpAIBAAKCAQEA4e2D/qPN08pzTac+a8ZmlP1ziJOXk45CynMPtva0rtK/RB26
// 7XC9wlRna4b3Ln8ew3q1ZcBjXwD4ppbTlmwAfQIaZTGJUgQbdsO9YA==
// -----END RSA PRIVATE KEY-----
// `,
KeyPath: "/Users/username/.ssh/id_rsa",
Port: "22",
Timeout: 60 * time.Second,
// Parse PrivateKey With Passphrase
Passphrase: "1234",
// Optional fingerprint SHA256 verification
// Get Fingerprint: ssh.FingerprintSHA256(key)
//Fingerprint: "SHA256:mVPwvezndPv/ARoIadVY98vAC0g+P/5633yTC4d/wXE"
// Enable the use of insecure ciphers and key exchange methods.
// This enables the use of the the following insecure ciphers and key exchange methods:
// - aes128-cbc
// - aes192-cbc
// - aes256-cbc
// - 3des-cbc
// - diffie-hellman-group-exchange-sha256
// - diffie-hellman-group-exchange-sha1
// Those algorithms are insecure and may allow plaintext data to be recovered by an attacker.
// UseInsecureCipher: true,
}
// Call Run method with command you want to run on remote server.
stdout, stderr, done, err := ssh.Run("ls -al", 60*time.Second)
// Handle errors
if err != nil {
panic("Can't run remote command: " + err.Error())
} else {
fmt.Println("don is :", done, "stdout is :", stdout, "; stderr is :", stderr)
}
}
scp
See [example/scp/scp.go](./example/scp/scp.go)
package main
import (
"fmt"
"github.com/appleboy/easyssh-proxy"
)
func main() {
// Create MakeConfig instance with remote username, server address and path to private key.
ssh := &easyssh.MakeConfig{
User: "appleboy",
Server: "example.com",
Password: "123qwe",
Port: "22",
}
// Call Scp method with file you want to upload to remote server.
// Please make sure the `tmp` floder exists.
err := ssh.Scp("/root/source.csv", "/tmp/target.csv")
// Handle errors
if err != nil {
panic("Can't run remote command: " + err.Error())
} else {
fmt.Println("success")
}
}
SSH ProxyCommand
See [example/proxy/proxy.go](./example/proxy/proxy.go)
ssh := &easyssh.MakeConfig{
User: "drone-scp",
Server: "localhost",
Port: "22",
KeyPath: "./tests/.ssh/id_rsa",
Proxy: easyssh.DefaultConfig{
User: "drone-scp",
Server: "localhost",
Port: "22",
KeyPath: "./tests/.ssh/id_rsa",
},
}
SSH Stream Log
See [example/stream/stream.go](./example/stream/stream.go)
func main() {
// Create MakeConfig instance with remote username, server address and path to private key.
ssh := &easyssh.MakeConfig{
Server: "localhost",
User: "drone-scp",
KeyPath: "./tests/.ssh/id_rsa",
Port: "22",
Timeout: 60 * time.Second,
}
// Call Run method with command you want to run on remote server.
stdoutChan, stderrChan, doneChan, errChan, err := ssh.Stream("for i in {1..5}; do echo ${i}; sleep 1; done; exit 2;", 60*time.Second)
// Handle errors
if err != nil {
panic("Can't run remote command: " + err.Error())
} else {
// read from the output channel until the done signal is passed
isTimeout := true
loop:
for {
select {
case isTimeout = <-doneChan:
break loop
case outline := <-stdoutChan:
fmt.Println("out:", outline)
case errline := <-stderrChan:
fmt.Println("err:", errline)
case err = <-errChan:
}
}
// get exit code or command error.
if err != nil {
fmt.Println("err: " + err.Error())
}
// command time out
if !isTimeout {
fmt.Println("Error: command timeout")
}
}
}