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

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.

Owner
Comments
  • Adding initial Hetzner Cloud provider

    Adding initial Hetzner Cloud provider

    This adds initial Hetzner Cloud provider. It's mostly referenced by the AWS EC2 provider but adapted to HCloud SDK.

    In Hetzner Cloud a server name is required and unique (at least per project, which is the scope of the API token). The server gets a random numeric ID but it's not used anywhere in UI to identify the server, so I thought instead it would be better to choose a name prefix and then a random string appended to it for the ID.

  • EC2: Block Device Attachment

    EC2: Block Device Attachment

    So before I go implementing the change I figured I'd ask first.

    Given the config mapping is just based on HCL I'm wondering if you support the equiv of aws_volume_attachment or if I'll need to add that in on my own?

  • Terminate when attach volume fails. Add option to control AZ placement

    Terminate when attach volume fails. Add option to control AZ placement

    Continues this thread: https://github.com/stephank/lazyssh/pull/6#discussion_r587772437

    I actually ended up in the state where I had a bunch of zombie instances! 😅

    This fixes that. It also adds the ability to specify the AZ since you can't attach EBS volumes across regions.

  • Support attaching volumes to an ec2 instance

    Support attaching volumes to an ec2 instance

    Fixes https://github.com/stephank/lazyssh/issues/5

    I wanted this so I could set up a archiver lazy host that uses a permanent ebs drive to act as a zfs target for backups. Cheap backups :)

    This project is really cool and there are so many cool projects to build off this thing. I already setup a lazy arm Nix builder so I can build things on beefy ec2 servers rather than my raspberry pi.

    Thanks for this

  • Docker images

    Docker images

    I'm working on this. Aiming for:

    • a 'from scratch' image with just the binary,
    • matching binaries on GitHub releases and inside the Docker image,
    • support for various architectures.
  • NixOS module

    NixOS module

    I'm working on this. Will try do the following, not sure if all of it makes sense:

    • Nix package
    • Nixpkgs overlay
    • NixOS module
    • nix-darwin module
    • home-manager module
Related tags
apache dubbo gateway,L7 proxy,virtual host,k8s ingress controller.
apache dubbo gateway,L7 proxy,virtual host,k8s ingress controller.

apache dubbo gateway,L7 proxy,virtual host,k8s ingress controller.

Jul 22, 2022
A memory-safe SSH server, focused on listening only on VPN networks such as Tailscale

Features Is tested to work with SCP Integrates well with systemd Quickstart Download binary for your architecture. We only support Linux. If you don't

Jun 10, 2022
Simple ssh client for persistent host info.
Simple ssh client for persistent host info.

zssh Simple ssh cli for persistent hosts information. Getting started (1) Go get and install $ go get -u github.com/zacscoding/zssh/... $ zssh --help

Dec 19, 2021
Gsshrun - Running commands via ssh on the server/hosting (if ssh support) specified in the connection file

Gsshrun - Running commands via ssh on the server/hosting (if ssh support) specified in the connection file

Sep 8, 2022
one simple git ssh server (just for learning git over ssh )

wriet one simple git ssh server use golang write one simple git ssh server how to running starting service docker-compose up -d add authorized_keys i

Mar 5, 2022
Server for hosting a Munki repository and dynamically generating manifests

About munki-server is an all-in-one server to deploy Munki with three main parts: HTTP file server for Munki clients Simple dynamic manifest generatio

Dec 7, 2021
HTTP(S)/WS(S)/TCP Tunnels to localhost using only SSH.

An open source serveo/ngrok alternative.

Dec 29, 2022
A CoreDNS plugin to serve temporary TXT records for validation purposes (eg. Let's Encrypt DNS-01)

temptxt Name temptxt - serves TXT records for validation purposes (eg. ACME DNS-01 challenge) updated through a HTTP api. Description The temptxt plug

Aug 23, 2022
Port-proxy - Temporary expose port for remote connections

Port proxy util Temporary expose port for remote connections. E.g. database/wind

Jan 27, 2022
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀
🤘 The native golang ssh client to execute your commands over ssh connection. 🚀🚀

Golang SSH Client. Fast and easy golang ssh client module. Goph is a lightweight Go SSH client focusing on simplicity! Installation ❘ Features ❘ Usage

Dec 24, 2022
Extended ssh-agent which supports git commit signing over ssh

ssh-agentx ssh-agentx Rationale Requirements Configuration ssh-agentx Configuration ssh-gpg-signer Linux Windows Signing commits after configuration T

Jun 29, 2022
Golang `net/rpc` over SSH using installed SSH program

Golang net/rpc over SSH using installed SSH program This package implements a helper functions to launch an RPC client and server. It uses the install

Nov 16, 2022
Ipctl - Listen to IP change and change your DNS' records dynamically

ipctl Listen to IP change and change your DNS' records dynamically Table of cont

Feb 17, 2022
Receive phone calls from anybody on the Web. Or host a telephony server yourself.
Receive phone calls from anybody on the Web. Or host a telephony server yourself.

WebCall WebRTC Telephony Server Browser based telephony over E2E-encrypted P2P-links with very high audio quality. WebCall is lightweight and easy to

Jan 5, 2023
“Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server!

Dear Port80 About The Project: “Dear Port80” is a zero-config TCP proxy server that hides SSH connection behind a HTTP server! +---------------------

Jun 29, 2022
Updating DNS records for dynamically changing IPs via the Cloudflare API

Cloudflare Dynamic IP Server About The Project About The Project Updating DNS re

Dec 24, 2021
Dec 13, 2022
Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform.

Seesaw v2 Note: This is not an official Google product. About Seesaw v2 is a Linux Virtual Server (LVS) based load balancing platform. It is capable o

Jan 3, 2023
A simple UDP server to make a virtual secure channel with the clients

udpsocket I made this package to make a virtual stateful connection between the client & server using the UDP protocol for a golang game server (as yo

Jun 18, 2022