Skip to content

Instantly share code, notes, and snippets.

@punchouty
Last active September 7, 2018 08:22
Show Gist options
  • Save punchouty/eedc3cfedc1a5119179d92b16ef65c04 to your computer and use it in GitHub Desktop.
Save punchouty/eedc3cfedc1a5119179d92b16ef65c04 to your computer and use it in GitHub Desktop.
Basics of AWS

Setup Web Server

  1. ssh ec2-user@34.201.105.246 -i learn-ec2-keypair.pem
  2. sudo su
  3. yum update -y
  4. yum install httpd -y
  5. service httpd restart
  6. chkconfig httpd on # start on restart
  7. service httpd status
  8. cd /var/www/html
  9. nano index.html

Conecting from Window

Basics Setup

  • Download putty.exe
  • Download puttygen.exe # in windows we cannot use pem file instead use ppk file
  1. Load pem file in puttygen
  2. It will generate private key
  3. Save private key as .ppk file (it will as for passphrase which can be ignored)
  4. Open putty and copy IP address in putty - ec2-user@34.201.105.246
  5. On left - Connection > SSH > Auth - give ppk file
  6. Optionally can save and connect

CLI

Login to machine

  1. ssh ec2-user@34.201.105.246 -i learn-ec2-keypair.pem
  2. aws configure # give access key and secret key
  3. aws s3 ls
  4. aws s3 mb s3://my-unique-bucket
  5. echo "hello world" > hello.txt
  6. ls # show hello.txt
  7. aws s3 cp hello.txt s3://my-unique-bucket
  8. aws s3 ls s3://my-unique-bucket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment