Skip to content

Instantly share code, notes, and snippets.

@eai04191
Last active January 26, 2019 15:34
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 eai04191/cbfe51f96324243e145324287b2b38d2 to your computer and use it in GitHub Desktop.
Save eai04191/cbfe51f96324243e145324287b2b38d2 to your computer and use it in GitHub Desktop.
ubuntuセットアップしたらやるやつら
# root login
# Set hostname
hostnamectl set-hostname hogehoge
# Add user
adduser eai
# Edit sudoers
visudo
# eai ALL=NOPASSWD: ALL
# To append to the EOF
# pubkey auth
mkdir -p /home/eai/.ssh
curl https://github.com/eai04191.keys >> /home/eai/.ssh/authorized_keys
chown -R eai: /home/eai/.ssh
chmod 700 /home/eai/.ssh
chmod 600 /home/eai/.ssh/authorized_keys
# User switch to eai
# Deny root login
sudo sed -i -e 's/PermitRootLogin yes/PermitRootLogin no/' /etc/ssh/sshd_config
# Deny password auth
sudo sed -i -e 's/PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config
# Restart ssh service
sudo systemctl restart ssh
# update
sudo apt update
sudo apt upgrade -y
# JP locale
sudo apt install language-pack-ja -y
sudo localectl set-locale LANG=ja_JP.UTF-8 LANGUAGE="ja_JP:ja"
# Timezone
sudo timedatectl set-timezone Asia/Tokyo
# Install Docker
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
# Install docker-compose
# https://github.com/docker/compose
# Install ctop
# https://github.com/bcicen/ctop
# Add user to docker group
sudo gpasswd -a $(whoami) docker
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment