Skip to content

Latest commit

 

History

History
43 lines (24 loc) · 2.77 KB

access-instance.md

File metadata and controls

43 lines (24 loc) · 2.77 KB

Accessing an Instance

To access an instance you will need to use ssh. Linux and macOS support this in the terminal. On Windows you can use WSL or PowerShell.

  1. Locate the keypair that you downloaded from AWS when you started your instances.

  2. Find the IP address of the instance you would like to connect to. This will be shown if you click on a instance from the list you have created. In the example below the ip address is 54.210.24.40

ip address

  1. Open a terminal.

  2. Copy the keypair to your ~/.ssh folder using cp keypair.pem ~/.ssh/keypair.pem where keypair.pem is the path to the downloaded keypair (note - the keypair generated by AWS is given in a .cer file for macOS. Can be used in exactly the same manner as the .pem)

  3. WARNING MAKE SURE YOU TYPE THIS COMMAND EXACTLY AS SHOWN Set your key to have the correct permissions by running chmod 0600 ~/.ssh/keypair.pem.

  4. Use the command ssh [email protected] -i ~/.ssh/keypair.pem. Replace the IP address with your IP.

You now have a terminal connected to your AWS instance (example on Sion's machine shown below)

drawing

Coping files

The best way to transfer files between your local machine and the instance is to use a git repo for your work and clone the repo to the AWS instance. To learn how to use git follow this guide.

Alternatively, consider using scp. The command to copy my_stuff.zip into the home directory on your EC2 instance will be something like scp -i ~/.ssh/keypair.pem my_stuff.zip [email protected]:~. Replace the IP address with your IP and my_stuff.zip with the file you want to copy. This method is a frustrating as you will need to zip and unzip stuff all the time.

Another option is to use a GUI based FTP program. (WinSCP)[https://winscp.net/eng/index.php] is a great option for Windows users. I cannot recommend FileZilla in good faith FileZilla as some vendors bundle it with Malware!! However, I assume if you install with apt from the Ubuntu repos it will be ok (have not tested this!)

Setting a desktop environment with AWS instance and Amazon Linux

Amazon have published this handy guide