Skip to content

Instantly share code, notes, and snippets.

@cloverstd
Last active June 20, 2024 12:40
Show Gist options
  • Save cloverstd/1f5a93ee11456aeae34b4be6fab9ad96 to your computer and use it in GitHub Desktop.
Save cloverstd/1f5a93ee11456aeae34b4be6fab9ad96 to your computer and use it in GitHub Desktop.
#!/bin/sh
apt update && apt install -y curl sudo
adduser --gecos "" --disabled-password cloverstd
usermod -aG sudo cloverstd
echo "cloverstd ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/90-cloverstd
runuser -u cloverstd -- bash -c "mkdir -p ~/.ssh && curl https://github.com/cloverstd.keys | tee -a ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys && chmod 0700 ~/.ssh"
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
echo "PermitRootLogin no" >> /etc/ssh/sshd_config
systemctl reload ssh
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
curl -sf https://get.docker.com | sh -
usermod -aG docker cloverstd
#!/bin/sh
apt update && apt install -y curl sudo
adduser --gecos "" cloverstd
usermod -aG sudo cloverstd
echo "cloverstd ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/90-cloverstd
runuser -u cloverstd -- bash -c "ssh-import-id-lp cloverstd && ssh-import-id-gh cloverstd"
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
echo "PermitRootLogin no" >> /etc/ssh/sshd_config
systemctl reload ssh
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p && \
curl -sf https://get.docker.com | sh -
usermod -aG docker cloverstd
@cloverstd
Copy link
Author

Ubuntu

wget https://gist.github.com/cloverstd/1f5a93ee11456aeae34b4be6fab9ad96/raw/241326207ad01e20ceae327149f646df12ec5909/ubuntu_init.sh -O /tmp/init.sh && bash /tmp/init.sh

Debian

wget https://gist.github.com/cloverstd/1f5a93ee11456aeae34b4be6fab9ad96/raw/241326207ad01e20ceae327149f646df12ec5909/debian_init.sh -O /tmp/init.sh && bash /tmp/init.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment