Skip to content

Instantly share code, notes, and snippets.

View xor-gate's full-sized avatar
👽

Jerry Jacobs xor-gate

👽
View GitHub Profile

Better SSH Authorized Keys Management

A seemingly common problem that people encounter is how to handle all of your users authorized_keys file.

People struggle over management, ensuring that users only have specific keys in the authorized_keys file or even a method for expiring keys. A centralized key management system could help provide all of this functionality with a little scripting.

One piece of functionality overlooked in OpenSSH is the AuthorizedKeysCommand configuration keyword. This configuration allows you to specify a command that will run during login to retrieve a users public key file from a remote source and perform validation just as if the authorized_keys file was local.

Here is an example directory structure for a set of users with SSH public keys that can be shared out via a web server:

@xor-gate
xor-gate / shortener.go
Last active August 29, 2015 14:27
URL shortener
package main
import (
"fmt"
"log"
"math/rand"
"net/http"
"time"
"github.com/garyburd/redigo/redis"
@xor-gate
xor-gate / !README.md
Last active November 26, 2015 20:12
c-struct-serializer-msgpack

C Struct Serializer to MessagePack

@xor-gate
xor-gate / 01README.md
Last active November 26, 2015 19:26
webdav golang 1.5

Golang 1.5 webdav readonly fileshare

@xor-gate
xor-gate / 01README.md
Last active November 26, 2015 19:23
xmacro-codegen

X-Macros Code Generator in C11

Because we can and the C-preprocessor is wasting CPU cycles anyway

@xor-gate
xor-gate / 01README.md
Last active March 11, 2024 12:05
Semhosting

QEMU Cortex-m3 with semihosting

@xor-gate
xor-gate / 01README.md
Last active November 23, 2015 23:12
Restic HTTP backend test server
@xor-gate
xor-gate / 01README.md
Last active November 26, 2015 19:22
http-sftp-share

HTTP-SFTP file server in golang

@xor-gate
xor-gate / mountpoint.c
Created December 23, 2015 13:22 — forked from twslankard/mountpoint.c
Using stat to determine programmatically whether a file is a mount point.
#include <assert.h>
#include <sys/stat.h>
#include <stdint.h>
#include <libgen.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char * argv[]) {
@xor-gate
xor-gate / url-shortner.c
Created December 25, 2015 12:26 — forked from ftonello/url-shortner.c
URL shortner implementation in C. This is just an example how it could be implemented. Ideally the lookup table should be pre-generated and not hardcoded.
/**
* Author: Felipe Ferreri Tonello <[email protected]>
*
* This url-shortner it only works with ASCII characters. It encodes and
* decodes ids.
* You can change base_x as you wish.
*
* It runs at least 20 times faster then a Python implementation.
*
* $ time python url-shortner.py -s I7