Skip to content

Instantly share code, notes, and snippets.

@Mic92
Last active December 27, 2015 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mic92/7262665 to your computer and use it in GitHub Desktop.
Save Mic92/7262665 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
if [[ $# -ne 1 ]]; then
echo "USAGE: $0 username" 1>&2
exit 1
fi
useradd -b /home -m "$1"
sudo -u "$1" ssh-keygen -t ecdsa -N "" -b 521 -f /home/$1/.ssh/id_ecdsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment