Skip to content

Instantly share code, notes, and snippets.

@mnyrop
Created September 21, 2023 20:37
Show Gist options
  • Save mnyrop/55a86031874bd29339b0d5a68ddf4979 to your computer and use it in GitHub Desktop.
Save mnyrop/55a86031874bd29339b0d5a68ddf4979 to your computer and use it in GitHub Desktop.
ssh into and/or deploy to sdr rails ec2 2023

SSH & Cap Notes

Set up SSH access

  1. Check spreadsheet for up-to-date IP & key info from dlts devops
  2. Request copy of correct pem file from dlts dev ops (in our case dlts-aws-sdr.pem) and download it.
  3. Copy the pem key from its current location (e.g., Downloads) to the path Capistrano (our deploy tool) expects using the following command:
    cp ~/Downloads/dlts-aws-sdr.pem ~/.ssh/dlts-aws-sdr.pem
  4. Protect the pem key by restricting its permissions:
    chmod 400 ~/.ssh/dlts-aws-sdr.pem

SSH into SDR Staging EC2

  1. Make sure you are on NYU VPN
  2. Make sure you followed "Set up SSH access" above
  3. Run ssh -i <path-to-pem> <user>@<IP-adress>; in our case:
    ssh -i ~/.ssh/dlts-aws-sdr.pem ubuntu@<staging-IP>
  4. Use command exit to exit the EC2's shell and return to your local machine

Deploy to Staging with Capistrano

  1. Make sure you followed "Set up SSH access" above
  2. Clone the spatial data repository repo and cd into it
  3. Install dependenies with bundle install
  4. Run cap staging deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment