Step by Step Set Up Your Own Free AWS Sandbox

Simon Sun
4 min readApr 17, 2021

This blog is written for beginners preparing to use AWS (Amazon Web Services) as their sandbox server since Amazon provides a full year (750hrs per month) trial time for basic service. After setting up this server, the implementation would be various, such as building a website, running Machine Learning mode, programming games.

Here we are only aiming for:

  • Setup the server
  • Connecting the server from any cmd prompt terminal
  • Set the developing environment for coding in the C language
  • Connect with Git Hub
  • Config editor Vim

Setup the server

  1. Apply an AWS Free Tier account through https://aws.amazon.com/
  2. Sign in to the Console (button to the up-right corner)
  3. Click EC2 (Virtual Service in the cloud) under All Services -> Compute

4. Click Launch Instance

5.Choose a Free Tier Eligible system and click the Select button to the right. Here use Ubuntu 20.04 LTS 64-bit (x86) as an example to create this instance.

6.Click the Review and Launch button to the bottom

7.Confirm the instance detail and click the Launch button on the next page

8.Create key pair/Choose existing key pair to improve the security level of your server. The key.pem file will be downloaded, and it will be used whenever accessing the server

9.Click Launch, and Amazon will launch this instant in 2–5 minutes. And we can click the button View Instances to see the status.

Connect the server from the command prompt terminal

  1. Click the name of our newly created server and click the Connect button to the up-right
  2. Follow the instructions on the next page, and please be noticed that the key pem file needs to use the full address. For this instance, the full command is

ssh -i “C:\Users\sunmi\Downloads\Simon_Holberton.pem” ubuntu@ec2–18–220–123–134.us-east-2.compute.amazonaws.com

3.Open a command prompt terminal. Here using Windows 10 as the example. Input the command above.

4.Connected

Set the developing environment for coding in C language(install make, man, GCC, gdb, Valgrind)

  1. Run command sudo –s to switch to the administrator mode since we are installing quite a few programs.
  2. Run command apt-get upgrade to get the information of the latest versions of essential programs.
  3. Run apt-get –y install make
  4. Run apt-get –y install man
  5. Run apt-get –y install gcc
  6. Run apt-get –y install valgrind
  7. Run apt-get –y install git-all
  8. Run apt-get –y install gdb

Setup Git Hub SSH connection

https://docs.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

  1. Open Git Bash
  2. Paste the text below, substituting in your GitHub email address ssh-keygen -t ed25519 -C your_email@example.com (ed25519 is your own id from GitHub, clicking web page above to check this ID)
  3. When you’re prompted to “Enter a file in which to save the key,” press Enter, this accepts the default file location.
  4. Press Enter key 3 times if you do not want to set up a security phrase.
  5. Your key will be saved under /root/.ssh/
  6. Enter command less /root/.ssh/id_ed25519.pub, and you will read a long string represent your key.
  7. Copy the string and paste to the GitHub->settings->SSH and GPG keys->New SSH key
  8. Pull a repository and test the developing environment.

Setup configurations of Vim

-This part is only for the reader who chooses Vim as a coding editor, and this is just the configuration the writer is using.

  1. Install Universal Ctags run apt install universal-ctags
  2. Clone vim configuration file from https://gist.github.com/miguelgrinberg/527bb5a400791f89b3c4da4bd61222e4
  3. Find the file .vimrc copy it to the home directory as ~/.vimrc
  4. Run Vim. The program will first download the needed add-ons, and under command mode, press “\” + “n” and “\” + “t” to enable the NerdTree and variable/functional monitor.
  5. Press “Ctrl + w”(holding) then “w” key to move the cursor among 3 different windows

--

--

Simon Sun

Students at Holberton School towards Full Stack Software Engineer