MCPcopy
hub / github.com/gliderlabs/ssh

github.com/gliderlabs/ssh @v0.3.8 sqlite

repository ↗ · DeepWiki ↗ · release v0.3.8 ↗
180 symbols 474 edges 26 files 72 documented · 40%
README

gliderlabs/ssh

GoDoc CircleCI Go Report Card OpenCollective Slack Email Updates

The Glider Labs SSH server package is dope. —@bradfitz, Go team member

This Go package wraps the crypto/ssh package with a higher-level API for building SSH servers. The goal of the API was to make it as simple as using net/http, so the API is very similar:

 package main

 import (
     "github.com/gliderlabs/ssh"
     "io"
     "log"
 )

 func main() {
     ssh.Handle(func(s ssh.Session) {
         io.WriteString(s, "Hello world\n")
     })  

     log.Fatal(ssh.ListenAndServe(":2222", nil))
 }

This package was built by @progrium after working on nearly a dozen projects at Glider Labs using SSH and collaborating with @shazow (known for ssh-chat).

Examples

A bunch of great examples are in the _examples directory.

Usage

See GoDoc reference.

Contributing

Pull requests are welcome! However, since this project is very much about API design, please submit API changes as issues to discuss before submitting PRs.

Also, you can join our Slack to discuss as well.

Roadmap

  • Non-session channel handlers
  • Cleanup callback API
  • 1.0 release
  • High-level client?

Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]

License

BSD

Extension points exported contracts — how you extend this code

Session (Interface)
Session provides access to information about an SSH session and methods to read and write to the SSH channel with an emb [1 …
session.go
Context (Interface)
Context is a package specific context interface. It exposes connection metadata and allows new values to be easily writt [1 …
context.go
PublicKey (Interface)
PublicKey is an abstraction of different types of public keys.
wrap.go
Option (FuncType)
Option is a functional option handler for Server.
ssh.go
SubsystemHandler (FuncType)
(no doc)
server.go
Signer (Interface)
A Signer can create signatures that verify against a public key.
wrap.go
Handler (FuncType)
Handler is a callback for handling established SSH sessions.
ssh.go
RequestHandler (FuncType)
(no doc)
server.go

Core symbols most depended-on inside this repo

Close
called by 27
server.go
Value
called by 17
context.go
SetValue
called by 12
context.go
ListenAndServe
called by 9
ssh.go
Permissions
called by 9
session.go
User
called by 7
session.go
PasswordAuth
called by 6
options.go
Serve
called by 5
server.go

Shape

Function 72
Method 72
FuncType 16
Struct 15
Interface 4
TypeAlias 1

Languages

Go100%

Modules by API surface

session.go33 symbols
server.go22 symbols
context.go22 symbols
ssh.go20 symbols
session_test.go16 symbols
tcpip.go8 symbols
options.go7 symbols
options_test.go6 symbols
wrap.go5 symbols
util.go5 symbols
example_test.go5 symbols
conn.go5 symbols

Dependencies from manifests, versioned

github.com/anmitsu/go-shlexv0.0.0-2020051411343 · 1×
golang.org/x/cryptov0.31.0 · 1×
golang.org/x/sysv0.28.0 · 1×

For agents

$ claude mcp add ssh \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact