An SSH Server that boxes you into a container.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
James Mills 3ee77ba0e5
Add Drone badge to README
3 weeks ago
.chglog Fix import paths 3 months ago
tools Add release tooling 10 months ago
.drone.yml Add support for persisting a host key (#2) 3 weeks ago
.gitignore Add support for persisting a host key (#2) 3 weeks ago
.goreleaser.yml Fix import paths 3 months ago
CHANGELOG.md Fix import paths 3 months ago
LICENSE Update README with more docs 10 months ago
Makefile Add release tooling 10 months ago
README.md Add Drone badge to README 3 weeks ago
_config.yml Set theme jekyll-theme-architect 10 months ago
go.mod Fix bug with pty support and suport non-pty commands 4 weeks ago
go.sum Fix bug with pty support and suport non-pty commands 4 weeks ago
main.go Add support for persisting a host key (#2) 3 weeks ago
server.go Add support for persisting a host key (#2) 3 weeks ago
utils.go Add support for persisting a host key (#2) 3 weeks ago
version.go Add support for authorized_keys 10 months ago

README.md

sshbox

Build Status

A very simple SSH server that "boxes" you into a sandbox environment using uLinux box utility for creating lightweight sandboxes -- or any process you want to use as a "sandbox".

Can also be used as a regualr SSH server 😉

Based on this example

Features

sshbox supports:

  • Authorized Key for authenticating sessions
  • Github for authenticating sessions
  • Sandboxing by running box or docker to sandbox sessions

Install

If you have a Go development environment setup with $GOPATH/bin/ in your $PATH the following will just work™ 😀

go get -u git.mills.io/prologic/sshbox

Otherwise you can build from source using git (You still need the Go compiler):

git clone https://git.mills.io/prologic/sshbox.git
cd sshbox
make

Prebuilt Binaries

There are prebuilt binaries I publish regularly to the Releases page you can download and install. Example:

wget https://git.mills.io/prologic/sshbox/releases/download/0.0.2/sshbox_0.0.2_linux_amd64.tar.gz
tar xvf sshbox_0.0.2_linux_amd64.tar.gz

Usage

Run an SSH server on the default port listening port ;2222, authorising users with an authorized_keys file and sandbox user sessions using box with an Alpine Linux container:

sshbox ~/.ssh/authorized_keys 'box run alpine /bin/sh'

Same thing but authorize users via their Github SSH Keys:

sshbox -g /dev/null 'box run alpine /bin/sh'

NOTE: Only tested on uLinux.

This may work on your system, your milage may vary. File an issue or pull request if you have any questions, issues or improvements.

License

sshbox is licensed under the terms of the MIT License