Last active
July 30, 2019 04:26
-
-
Save mohemohe/fbac792ff22556c43148a28e23817ac7 to your computer and use it in GitHub Desktop.
ブチミリ標準StackScript
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 | |
TARGET_USER=mohemohe | |
groupadd -f wheel | |
useradd -G wheel -m -s /bin/bash ${TARGET_USER} | |
mkdir -p /home/${TARGET_USER}/.ssh | |
chmod 700 /home/${TARGET_USER}/.ssh | |
curl https://github.com/${TARGET_USER}.keys > /home/${TARGET_USER}/.ssh/authorized_keys | |
chmod 600 /home/${TARGET_USER}/.ssh/authorized_keys | |
chown ${TARGET_USER}: -R /home/${TARGET_USER} | |
sed -i 's|#PasswordAuthentication yes|PasswordAuthentication no|' /etc/ssh/sshd_config | |
sed -i 's|#PermitRootLogin yes|PermitRootLogin no|' /etc/ssh/sshd_config | |
systemctl restart sshd | |
echo '%wheel ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers | |
timedatectl set-timezone Asia/Tokyo | |
hostnamectl set-hostname $(curl http://checkip.amazonaws.com/ | sed 's|\.|-|g') | |
apt update | |
env DEBIAN_FRONTEND=noninteractive apt install -y docker.io docker-compose | |
docker swarm join --token SWMTKN-1-チゥフ!ッゥュ!!゙ゥフリフュュリッ゙!リ!フリッッリゥ!ッ!!!リッ!!ゥフフュリュリ゙フリイフ!゙リ゙リフフュ!フュチチヂ!゙ゥリュリュリ 666.777.888.999:2377 |
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 | |
TARGET_USER=mohemohe | |
groupadd -f wheel | |
useradd -G wheel -m -s /bin/bash ${TARGET_USER} | |
mkdir -p /home/${TARGET_USER}/.ssh | |
chmod 700 /home/${TARGET_USER}/.ssh | |
curl https://github.com/${TARGET_USER}.keys > /home/${TARGET_USER}/.ssh/authorized_keys | |
chmod 600 /home/${TARGET_USER}/.ssh/authorized_keys | |
chown ${TARGET_USER}: -R /home/${TARGET_USER} | |
sed -i 's|#PasswordAuthentication yes|PasswordAuthentication no|' /etc/ssh/sshd_config | |
sed -i 's|#PermitRootLogin yes|PermitRootLogin no|' /etc/ssh/sshd_config | |
systemctl restart sshd | |
echo '%wheel ALL=(ALL:ALL) NOPASSWD:ALL' >> /etc/sudoers | |
timedatectl set-timezone Asia/Tokyo | |
hostnamectl set-hostname $(curl http://checkip.amazonaws.com/ | sed 's|\.|-|g') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment