This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |