Guest User

Untitled

a guest
Aug 14th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. # A shell script for setting up a Vultr box with docker, docker-compose, vim, tmux and a deploy user
  2. # This is the most equivalent I could find to a t2.small on a CentOS 7 x64 system - 1 VCP, 2 Gig Ram, 40 Gig. disk
  3.  
  4.  
  5. # Install required to run docker etc.
  6. yum install -y tmux docker git docker-compose
  7.  
  8.  
  9. # Create deploy user and add your public key to login
  10. useradd deploy
  11. mkdir /home/deploy/.ssh
  12. chmod 700 /home/deploy/.ssh
  13.  
  14. vim /home/deploy/.ssh/authorized_keys # Add you public key
  15. chmod 400 /home/deploy/.ssh/authorized_keys
  16. chown deploy:deploy /home/deploy -R
  17.  
  18.  
  19. # Add depoy user to the sudo group visudo - Comment all existing user/group grant lines and add:
  20. root ALL=(ALL) ALL
  21. deploy ALL=(ALL) ALL
  22.  
  23.  
  24. # Disable root and lock down the user per an IP Address as well as public key
  25. vim /etc/ssh/sshd_config
  26.  
  27. PermitRootLogin no
  28. PasswordAuthentication no
  29. AllowUsers deploy@xxx.xxx.xxx.xxx deploy@yyy.yyy.yyy.yyy
  30. service ssh restart
Add Comment
Please, Sign In to add comment