Skip to content

Instantly share code, notes, and snippets.

@denielchiang
Created February 16, 2020 22:29
Show Gist options
  • Select an option

  • Save denielchiang/fc4ba8441eed810aae89b33c2e4d8980 to your computer and use it in GitHub Desktop.

Select an option

Save denielchiang/fc4ba8441eed810aae89b33c2e4d8980 to your computer and use it in GitHub Desktop.
When server has been created do this first
useradd -m -s /bin/bash deploy
"deploy ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/10-app-deploy
mkdir -p ~deploy/.ssh
chown deploy:deploy ~deploy/.ssh
chmod 700 ~deploy/.ssh
cp ~root/.ssh/authorized_keys ~deploy/.ssh
chown deploy:deploy ~deploy/.ssh/authorized_keys
chmod 600 ~deploy/.ssh/authorized_keys
# exit and connect again
ssh -A deploy@${web-server}
# make sure works
sudo -s
exit
# create source folder
mkdir -p ~/build
cd ~/build
git clone https://github.com/cogini/mix-deploy-example # or your app repo
cd mix-deploy-example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment