#!/bin/sh if [ "$(id -u)" -ne 0 ]; then echo "This script should be run as root. Aborting..." > /dev/stderr exit 1 fi echo "Creating SSH key..." ssh-keygen -t rsa -b 4096 -q -N "" -f ~/.ssh/id_rsa echo "Adding SSH key to authorized..." cat ~/.ssh/rsa.pub >> ~/.ssh/authorized_keys