sshd-lite

command module
v1.55.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

sshd-lite

GoDoc CI

A lightweight, cross-platform SSH daemon written in Go. It runs shells and commands as the sshd-lite process user, without operating-system user lookup or privilege switching.

Install

Download the latest binary from GitHub Releases, use the installer, or install from source:

curl https://i.jpillora.com/sshd-lite! | bash

Or install from source:

go install github.com/jpillora/sshd-lite@latest

Features

  • Interactive shells and remote command execution
  • Password, public-key, GitHub-key, or no authentication
  • SFTP, with optional confinement to the configured work directory
  • Local and reverse TCP forwarding
  • Built-in SSH client with known-host verification
  • Mosh-compatible terminal sessions over UDP
  • Ed25519 and RSA server keys
  • Linux, macOS, and Windows binaries with no runtime dependencies

Quick start

Start a password-authenticated server:

sshd-lite --port 2222 user:pass
ssh -p 2222 user@localhost

Enable SFTP and restrict it to the work directory:

sshd-lite --port 2222 --workdir /srv/ssh --sftp --sftp-wd user:pass

Use the built-in client for a shell or remote command:

sshd-lite client --port 2222 user@host
sshd-lite client --port 2222 user@host 'uname -a'

Invoking the binary through a symlink named ssh-lite selects client mode automatically. The client trusts new hosts into its private XDG state file and still warns on changed keys. Use --strict-hosts to confirm new keys, --share-known-hosts to use ~/.ssh/known_hosts, or --insecure only to disable verification.

Enable Mosh on the server and client, with both TCP and UDP open on the same port:

sshd-lite --mosh --port 2222 user:pass
sshd-lite client --mosh --port 2222 user@host

See the Mosh guide for setup, interoperability, session lifetime, terminal behavior, limitations, and Go API usage.

Configuration summary

  • The authentication argument may be user:pass, an unrestricted authorized_keys path, github.com/user, or none.
  • Shells, commands, and SFTP start in --workdir. --sftp-wd additionally makes that directory SFTP's virtual root.
  • Sessions inherit the process environment by default. Use --no-inherit-env, --no-global-env, or --no-client-env to tighten environment handling.
  • SFTP and TCP forwarding are disabled unless explicitly enabled.
  • MAX_PENDING_HANDSHAKES sets the CLI default for concurrent unauthenticated handshakes.

Run sshd-lite --help or sshd-lite client --help for the complete CLI reference.

Go packages

The public sshd package configures and runs servers. client provides the built-in SSH client behavior, mosh is the opt-in Mosh API, and xssh exposes lower-level SSH connection and handler APIs.

See the architecture guide for package ownership, dependency boundaries, listener lifecycle, and extension points.

Documentation

License

MIT © 2026 Jaime Pillora

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package client implements the sshd-lite SSH client.
Package client implements the sshd-lite SSH client.
example
mosh command
This program embeds both peers.
This program embeds both peers.
internal
mosh
Package mosh embeds mosh-go's wire protocol on a shared UDP port.
Package mosh embeds mosh-go's wire protocol on a shared UDP port.
mosh/ssp
Adapted from mosh-go v0.5.2 (MIT); see ../LICENSE.mosh-go.
Adapted from mosh-go v0.5.2 (MIT); see ../LICENSE.mosh-go.
sshconn
Package sshconn owns context-aware SSH dialing and handshake deadlines.
Package sshconn owns context-aware SSH dialing and handshake deadlines.
terminal
Package terminal owns platform PTYs and their child processes.
Package terminal owns platform PTYs and their child processes.
Package sshd provides type aliases for the sshd package.
Package sshd provides type aliases for the sshd package.
key
sshtest
Package sshtest provides an AI-friendly test harness for SSH servers and clients.
Package sshtest provides an AI-friendly test harness for SSH servers and clients.
sshtest/log
Package log provides slog capture utilities for testing.
Package log provides slog capture utilities for testing.
sshtest/scenario
Package scenario provides data types and YAML parsing for SSH test scenarios.
Package scenario provides data types and YAML parsing for SSH test scenarios.
xhttp
Package xhttp retains the legacy HTTP test helpers.
Package xhttp retains the legacy HTTP test helpers.
xnet
Package xnet retains the legacy network test helpers.
Package xnet retains the legacy network test helpers.
Package winpty provides a Windows ConPTY implementation behind a small, creack/pty-shaped API (Start, StartWithSize, Setsize).
Package winpty provides a Windows ConPTY implementation behind a small, creack/pty-shaped API (Start, StartWithSize, Setsize).
Package xssh provides a symmetric SSH connection handler that works for both server and client connections.
Package xssh provides a symmetric SSH connection handler that works for both server and client connections.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址