• Stars
    star
    475
  • Rank 92,454 (Top 2 %)
  • Language
    Go
  • License
    GNU Affero Genera...
  • Created almost 4 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A jump-host SSH server that starts machines on-demand

LazySSH

LazySSH is an SSH server that acts as a jump host only, and dynamically starts temporary virtual machines.

If you find yourself briefly starting a virtual machine just to SSH into it and try something out, LazySSH is an attempt to automate that flow via just the ssh command. LazySSH starts the machine for you when you connect, and shuts it down (some time after) you disconnect.

Another possible use is to have LazySSH sit in front of a build server to start specific types of machines for your build. (Think different CPU architectures or operating systems.)

Important: LazySSH is a young piece of code. If you're going to use it to create resources that cost money (like AWS EC2 instances), keep a close eye on usage. If, for example, you put your laptop to sleep at the wrong time, or LazySSH crashes for whatever reason, it may leave resources running.

Important: The security of LazySSH has not been tested in any way, so it's probably best to run it in a closed setting. (Not facing the public internet or otherwise firewalled.) The SSH server implementation is based on golang.org/x/crypto.

License: AGPL v3

Usage

There are several ways to get LazySSH:

  • Grab a binary from the releases page.

  • Docker images are available on Docker Hub as stephank/lazyssh.

  • Nix users, whether you use flakes or not, see the documentation in flake.nix.

  • If you instead want to build LazySSH yourself, you need at least Go 1.13, then just go build.

You need to generate an SSH host key and client key. The host key is what the server uses to identify itself, while the client key is what you connect with.

# Both of these also generate a .pub file with the public half of the key pair.
ssh-keygen -t ed25519 -f lazyssh_host_key
ssh-keygen -t ed25519 -f lazyssh_client_key

Now create a config.hcl file that looks like:

server {
  # Set this to the contents of lazyssh_host_key generated above.
  host_key = <<-EOF
    -----BEGIN OPENSSH PRIVATE KEY-----
    [...]
    -----END OPENSSH PRIVATE KEY-----
  EOF

  # Set this to the contents of lazyssh_client_key.pub generated above.
  authorized_key = <<-EOF
    ssh-ed25519 [...]
  EOF
}

The server block is followed by one or more target blocks. Here are the types of targets currently supported, and links to the documentation:

Once your config is ready, you can start the server:

./lazyssh -config ./config.hcl

Using Docker? You can start the container with, for example:

docker run \
  -p 7922:7922 \
  -v /path/to/config.hcl:/config.hcl:ro \
  stephank/lazyssh

You usually need an entry for LazySSH in your ~/.ssh/config, because the ssh command otherwise doesn't make all options available for jump-hosts. Here is a sample config:

Host lazyssh
  Hostname localhost
  Port 7922
  User jump
  PreferredAuthentications publickey
  IdentityFile ~/path/to/lazyssh_client_key
  IdentitiesOnly yes

Now you should be ready to go:

ssh -J lazyssh user@mytarget

For more details, see the included documentation.

More Repositories

1

orona

Bolo, a game of tank warfare, rewritten for modern browsers.
CoffeeScript
263
star
2

surreal

Reviving the original Unreal Tournament on modern systems.
C++
83
star
3

docker-for-mac-nfs

NFS shares in Docker for Mac
Shell
62
star
4

villain

Real-time browser games in JavaScript and CoffeeScript.
CoffeeScript
58
star
5

castling.club

Challenge someone to a game of chess using toots!
TypeScript
50
star
6

hyper-staticfile

Static file-serving for Hyper 0.14
Rust
49
star
7

yarn-plugin-nixify

Yarn v3 plugin to help with Nix packaging
TypeScript
48
star
8

rvsim

A RISC-V simulator implementing RV32G[C].
Rust
31
star
9

domjuice

DOM-aware dynamic templates
CoffeeScript
29
star
10

vindinium-client

Client library for vindinium.org
JavaScript
25
star
11

inject_dylib

Load a dynamic library and start a thread in another process
C
23
star
12

arashi-js

ArashiJS is a Tempest-clone in JavaScript / HTML5
JavaScript
18
star
13

composer-plugin-nixify

Composer plugin to help with Nix packaging
PHP
14
star
14

yaml.node

A Node.js binding for LibYAML.
JavaScript
13
star
15

docker-archlinux

Docker images of Arch Linux.
Shell
12
star
16

mcdisablewheel

Small patch for MCPatcher to disable the mouse wheel.
Java
10
star
17

nagios-bird

Nagios plugins for monitoring the BIRD routing daemon.
Perl
8
star
18

node-libalac

Apple Lossless codec bindings
C++
7
star
19

diridp

OIDC IdP that issues tokens as local files
Rust
6
star
20

tokio-smtp

Implementation of SMTP for Rust and Tokio.
Rust
6
star
21

nix-darwin-installer

Combined Nix / nix-darwin installer.
SCSS
6
star
22

libvirtweb

A simple web interface to libvirt
Java
6
star
23

openwrt

Fork of git://nbd.name/openwrt.git
C
5
star
24

webcoin-dogecoin

Experimental Dogecoin support for Webcoin
C++
5
star
25

sshiny

Work in progress SSH client & server
JavaScript
5
star
26

node-arrays

Pure-JS implementation of Typed Arrays
JavaScript
4
star
27

json-ns

A subset of JSON-LD
Rust
4
star
28

yarn-nixpkgs

A prototype tool for automating packaging of Node.js applications for NixOS / Nixpkgs.
TypeScript
3
star
29

luci2-netifd

Fork of git://nbd.name/luci2/netifd.git
C
2
star
30

jetpack

Jetpack is a small arcade game originally written by Mark Bradley.
C
2
star
31

out-game

'Out', the tiny arcade game I made for Ludum Dare 22
CoffeeScript
1
star
32

js-diff-benchmarks

Benchmarks of JS object diffing libraries.
JavaScript
1
star
33

authproto

Simple Auth Service Prototype
JavaScript
1
star
34

dumpnar

Minimal tool to produce a Nix NAR archive.
C++
1
star
35

broccoli-bundle-assets

Create bundles of JS and CSS assets
JavaScript
1
star
36

upgradeEx

Response object for HTTP Upgrade/CONNECT
JavaScript
1
star
37

broccoli-angular-templates

Inline files as ng-template script tags
JavaScript
1
star
38

zonemaster

DNS server implementing just zone transfer
JavaScript
1
star