Skip to content

Instantly share code, notes, and snippets.

View jonaseicher's full-sized avatar

Jonas Eicher jonaseicher

  • Munich
View GitHub Profile
@ygotthilf
ygotthilf / jwtRS256.sh
Last active May 18, 2024 13:59
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@larrybolt
larrybolt / bootstrap-server.sh
Created August 23, 2014 13:55
Bootstrap server to use with ansible
#!/usr/bin/env bash
if [ $# -eq 0 ]; then
echo "please supply a servername: bootstrap-server.sh node.example.com"
exit 1
fi
username=`whoami`
# copy public rsa key to server for root user
read -r -p "Transfer ssh public keys to server for root? [y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]; then
@jaz303
jaz303 / ansible-bootstrap
Last active March 28, 2022 00:27
Shell script to prepare a fresh machine for management with Ansible
#!/bin/bash
# usage: boostrap mybox.example.com path/to/id_rsa.pub
# preconditions: fresh install of Debian with ssh installed/running
# effects:
# - hostname is set
# - `ansible` user created with disabled password and added to sudo/ssh groups
# - specified public key added to user's authorized_keys
# - sudoers updated to allow no password operations