CHTJonas

Fresh Install

Dec 8th, 2016 (edited)
394
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # User account setup
  2. # sudo addgroup --gid 2001 jonas
  3. addgroup --gid 1001 chtjonas
  4. adduser --uid 1001 --gid 1001 chtjonas
  5. usermod -aG sudo chtjonas
  6. touch /home/chtjonas/.hushlogin
  7. touch /home/chtjonas/.sudo_as_admin_successful
  8. sudo -iu chtjonas
  9. sudo deluser --remove-home ubuntu
  10.  
  11. # SSH
  12. mkdir ~/.ssh
  13. wget https://chtjonas.keybase.pub/authorized_keys -O ~/.ssh/authorized_keys
  14. chmod 600 ~/.ssh/authorized_keys
  15. nano ~/.ssh/authorized_keys
  16. sudo nano /etc/ssh/sshd_config
  17. sudo systemctl restart sshd
  18. sudo ufw allow OpenSSH
  19. sudo ufw enable
  20. sudo usermod -p '!' root
  21. sudo passwd -l root
  22.  
  23. # Configure system
  24. sudo timedatectl set-timezone UTC
  25. sudo localectl set-locale LANG=en_GB.UTF-8
  26. sudo dpkg-reconfigure locales
  27. sudo apt purge whoopsie landscape-common
  28.  
  29. # Terminal multiplexing
  30. sudo apt install mosh byobu
  31. sudo ufw allow 60000:61000/udp
  32. byobu-enable
  33.  
  34. # Optionally, install some common packages
  35. sudo apt update
  36. sudo apt full-upgrade
  37. sudo apt install git wget curl zip unzip htop make binutils moreutils sharutils rename time
  38. sudo apt install dnsutils net-tools rsync traceroute mtr-tiny whois pv netcat-openbsd socat
  39. sudo apt install apticron chrony molly-guard build-essential
  40. sudo apt update && sudo apt full-upgrade && sudo apt autoremove
  41.  
  42. # Install Docker-CE
  43. sudo apt install apt-transport-https ca-certificates software-properties-common
  44. curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  45. echo "deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee -a /etc/apt/sources.list.d/docker.list
  46. sudo apt update
  47. sudo apt install docker-ce docker-compose
RAW Paste Data