Skip to content

Instantly share code, notes, and snippets.

@cloverstd
Last active April 21, 2024 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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 "" 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
#!/bin/sh
apt update && apt install -y curl sudo && \
adduser --disabled-password --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