-
-
Save stereosupersonic/43367f3934b6de2354779aa1744b4fcc to your computer and use it in GitHub Desktop.
setup basic login
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# enable host for stereosonic or another user | |
set -e | |
echo "Start" | |
PUBKEY="" # TODO if key is not on github | |
id -u stereosonic > /dev/null 2>&1 || \ | |
adduser stereosonic --disabled-password \ | |
--gecos "" --quiet | |
mkdir -p /home/stereosonic/.ssh | |
echo "$PUBKEY" \ | |
> /home/stereosonic/.ssh/authorized_keys | |
apt-get update | |
apt-get install -yq --no-install-recommends curl sudo openssh-server | |
curl https://github.com/stereosupersonic.keys >> /home/stereosonic/.ssh/authorized_keys | |
chown -R stereosonic /home/stereosonic/.ssh | |
apt-get install sudo | |
grep -q stereosonic /etc/sudoers || \ | |
echo "stereosonic ALL = (ALL) \ | |
NOPASSWD: ALL" >> /etc/sudoers | |
echo "FINISH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
bash <(curl -Ls https://gist.githubusercontent.com/stereosupersonic/43367f3934b6de2354779aa1744b4fcc/raw/setup.sh)