Skip to content

Instantly share code, notes, and snippets.

View kbon's full-sized avatar

kbon

View GitHub Profile
@kbon
kbon / ssh_generate_config.sh
Created October 1, 2015 08:32
Generate ~/.ssh/config from files in ~/.ssh/config.d
#!/bin/bash
#
# Generates SSH config from elements in config.d directory
# 2013/09/24 kristiaan.bonjean@newtec.eu
#
# Returns last modification epoch seconds for given file
# Usage: GetLastModification path
GetLastModification() {
@kbon
kbon / throughssh
Last active June 26, 2017 09:19
SSH config partial allowing to hop through an arbitrary host
# Generic throughssh command
Host *.throughssh.*
User root
ProxyCommand ssh -A -q `echo %h | sed -e 's/^[^\.]*\.throughssh\.//'` -W `echo %h | sed -e 's/\.throughssh\.[^\.]*$//'`:%p
GSSAPIAuthentication yes
ForwardX11Trusted yes
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
LogLevel ERROR
SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES