Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Latest commit

 

History

History
74 lines (59 loc) · 5.18 KB

README.md

File metadata and controls

74 lines (59 loc) · 5.18 KB

ssh-knock-interceptor

LICENSE Renovate


Make jumphosts and knock easier without messing up your ssh config.

Features

  • Consolidate ssh knock config into dedicated config file
  • No dependency on knockd

Requirements

Installation

  1. Clone the repo in your home folder: git clone https://github.com/timo-reymann/ssh-knock-interceptor.git $HOME/.ssh-knock-interceptor

Usage

  1. Add to your ssh config:
    Host *.example.com
       ProxyCommand bash -c 'source $HOME/.ssh-knock-interceptor/init %h %p'
  2. Create the config file for the knock hosts in .ssh/knock-config:
    [app*.example.com]
    sequence = 1000 2000 3000
    host     = jumphost-apps.example.com
    
    [web*.example.com]
    sequence = 1001 2001 3001
    host     = jumphost-webservers.example.com
    
    [advanced*.example.com]
    use_udp  = true
    sequence = 1001 2001:tcp 3001
    host     = jumphost-webservers.example.com

Motivation

Maintaining knock commands in your ssh config becomes a huge mess over time.

Documentation

How it works

It consists of three parts:

  • Python script
    • parse and validate ini file
    • knock with python
  • Bash wrapper
    • to source env vars
    • execute ssh command in same tty
  • Integration into existing ssh config

Contributing

I love your input! I want to make contributing to this project as easy and transparent as possible, whether it's:

  • Reporting a bug
  • Discussing the current state of the configuration
  • Submitting a fix
  • Proposing new features
  • Becoming a maintainer

To get started please read the Contribution Guidelines.

Development