From 97036270b630059dc55e70725fb4b65554bc36ba Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 9 Nov 2013 13:46:37 +0100 Subject: [PATCH] add a script to add tuer users --- adduser | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 adduser 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 . -- 2.30.2