Skip to content

Instantly share code, notes, and snippets.

@clarkzjw
Last active June 12, 2026 16:45
Show Gist options
  • Select an option

  • Save clarkzjw/04efe1988f68aaf6c165bfda3e1d561c to your computer and use it in GitHub Desktop.

Select an option

Save clarkzjw/04efe1988f68aaf6c165bfda3e1d561c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -ex -o pipefail
# install required packages
apt-get update && apt-get install openssh-server sudo curl -y
# create cccadmin user if not present
if ! id -u cccadmin >/dev/null 2>&1; then
useradd -m -s /bin/bash cccadmin
fi
# setup ssh authorized_keys
mkdir -p /home/cccadmin/.ssh
curl -o /home/cccadmin/.ssh/authorized_keys https://github.com/clarkzjw.keys
chown -R cccadmin:cccadmin /home/cccadmin/.ssh
chmod 700 /home/cccadmin/.ssh
chmod 600 /home/cccadmin/.ssh/authorized_keys
mkdir -p /root/.ssh
curl -o /root/.ssh/authorized_keys https://github.com/clarkzjw.keys
chown -R root:root /root/.ssh
chmod 700 /root/.ssh
chmod 600 /root/.ssh/authorized_keys
# add cccadmin user to the sudo group
usermod -a -G sudo cccadmin
# install tailscale
curl -fsSL https://tailscale.com/install.sh | sh
set +x
echo -e "\nConfiguration complete\n"
echo -e "Start Tailscale by running:\n"
echo -e " sudo tailscale up --netfilter-mode=off --accept-dns=false\n"
echo -e "Please send the Tailscale login link to Jinwei Zhao <clarkzjw@uvic.ca>"
echo -e "Note: Please do NOT power off the machine until we confirmed accepting the link"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment