Skip to content

Instantly share code, notes, and snippets.

@mikechau
Created June 9, 2013 10:10
Show Gist options
  • Save mikechau/5743033 to your computer and use it in GitHub Desktop.
Save mikechau/5743033 to your computer and use it in GitHub Desktop.
Amazon EC2 + Sinatra Application Deployment
## connecting
sudo chmod 0600 ~/Downloads/sandbox.pem
ssh -i ~/Downloads/sandbox.pem ubuntu@ec2-23-22-18-249.compute-1.amazonaws.com
## create users
sudo adduser mike
## add user to admin
sudo adduser mike admin
## switch user
sudo su mike
## show sudo
cat /etc/sudoers
## security
mkdir ~/.ssh
touch authorized_keys
## get personal pub key from local machine
cat ~/.ssh/id_rsa.pub
## paste pub key into authorized_keys
vim authorized_keys
-> paste, save, exit
## ssh into machine, dont need to paste name if same as local machine
ssh ec2-23-22-18-249.compute-1.amazonaws.com
## install ruby -> remember to update first
sudo apt-get install ruby1.9.1-dev
ls -la /usr/bin | grep ruby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment