X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=ssh-adduser%2Finstall.sh;h=a4f9a4634131cfc1798d2703d0ebdc0e9d05d946;hb=19b83dd6fccb1db44426e6e2acfc58da6e3ba9ac;hp=6400a0c4f75efba196ca48b5fd878af73b1cb1e2;hpb=92fdd2f735ecdc89760a0a474e9bf99a2a696b12;p=webi-installers%2F.git diff --git a/ssh-adduser/install.sh b/ssh-adduser/install.sh deleted file mode 100644 index 6400a0c..0000000 --- a/ssh-adduser/install.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -set -e -set -u - -# TODO: a more complete VPS setup - -# TODO would $EUID be better? -if [ "root" != "$(whoami)" ]; then - echo "webi adduser: running user is already a non-root user" - exit 0 -fi - -#apt-get -y update -#apt-get -y install curl wget rsync git - -# Add User -# TODO: might there be a better name? -# me, this, user, self, person, i, who, do, tron -adduser --disabled-password --gecos "" me -my_password=$(openssl rand -hex 16) -printf "$my_password"'\n'"$my_password" | passwd me -adduser me sudo -echo "me ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/me -sudo -i -u me bash -c 'ssh-keygen -b 2048 -t rsa -f /home/me/.ssh/id_rsa -q -N ""' -mkdir -p /home/me/.ssh/ -cp -r $HOME/.ssh/authorized_keys /home/me/.ssh/ -chmod 0600 me:me /home/me/.ssh/authorized_keys -chown -R me:me /home/me/.ssh/ - -# Install webi for the new user -sudo -i -u me bash -c 'curl -fsSL https://webinstall.dev/webi | bash' \ - || sudo -i -u me bash -c 'wget -q -O - https://webinstall.dev/webi | bash' - -# TODO ensure that ssh-password login is off - -echo "Created user 'me' with password '$my_password'" diff --git a/ssh-adduser/install.sh b/ssh-adduser/install.sh new file mode 120000 index 0000000..a4f9a46 --- /dev/null +++ b/ssh-adduser/install.sh @@ -0,0 +1 @@ +../ssh-utils/ssh-adduser.sh \ No newline at end of file