From: Ralf Jung Date: Sat, 9 Nov 2013 12:46:37 +0000 (+0100) Subject: add a script to add tuer users X-Git-Url: https://git.ralfj.de/saartuer.git/commitdiff_plain/97036270b630059dc55e70725fb4b65554bc36ba add a script to add tuer users --- diff --git a/adduser b/adduser new file mode 100755 index 0000000..19b10ce --- /dev/null +++ b/adduser @@ -0,0 +1,20 @@ +#!/bin/bash + +USER="$1" +if [[ -z "$USER" ]]; then + echo "Usage: $0 username" + exit 1 +fi +if [[ "$(whoami)" != "root" ]]; then + echo "Please get root first" + exit 1 +fi + +adduser "$USER" --disabled-password +sudo adduser "$USER" tuer +cd /home/"$USER" +mkdir .ssh +echo -n "I will now open nano, please paste the SSH key in there! " +read +nano .ssh/authorized_keys +chown "$USER": -R .