So, you are struggling with your boring Vi editor? or that default app that your mac provides for a functionality? Kill me if you are the guy with that beard who loves Linux n Vi, but this tutorial is meant for the rest of the world’s population.
Simple Steps Ahead :
ln -s /usr/local/bin/
open ~/.bash_profile (if it exists, else touch
~/.bash_profile before this step)
- add the line
export PATH = /usr/local/bin:$PATH
source ~/.bash_profile to refresh the file bash_profile
- type the app’s desired short name that you added in the first step.
The application should open!
This is a very quick tutorial on how to setup your first Amazon EC2 Linux instance without much hassles. Please note that this is a very INSECURE way but it is fine as long a you understand how is it insecure. For example, when inbound IP is 0.0.0.0 it allows all the IPv4 Addresses to access your instance from outside via the corresponding protocol.
Important Note : To create an AWS Account you have to provide your credit card or debit card details to Amazon but as long as you are using its free tier it won’t charge you at all. If I am not wrong it is for a year. But please check their policies before proceeding but I have some credit in my AWS account but have never been charged yet. So, nothing to worry. Just choose the right FREE TIER for your First or Trial usage of AWS EC2 Instance.
It’s been assumed that you have an AWS Account ready for usage!
- Login to your AWS Account
2. Choose EC2 as the option
3. Create a Key Pair by Clicking on Key Pair in the left column
4. You will see the following screen. Follow the steps accordingly
This will create a key and the private key will be added to your Downloads folder. It is a PEM or PPK format file. If you are using Mac OS you will get a txt file downloaded. For example FunnyName.pem.txt. In Windows OS you may get a PPK file which has to be converted to PEM using PuttyGen or something similar. you can google for more details.
5. Create an Instance with the following steps
First Option – Amazon Linux
First Option and then, the Blue Tab
Nothing and the Blue Tab
Nothing and the Blue Tab
You can add rules for traffic here
Select the Pair you created and Launch Instance
6. Login using the tutorial for Mac Users. There will be a slightly different login way for Windows users but not very tough if you google. All you gotta do is use Putty or WinSCP for access after generating your PEM key from PPK key.
Today I struggled for 15 minutes before figuring out how to SSH to Linux Server from mac (Being my first time as a previous Putty user from Windows). Mac had some recent changes apparently regarding OpenSSH protocol implementation. ‘M not sure though. All you gotta do is follow the simple steps (if you don’t know a quicker way) in your mac terminal:
mv <your_pem_file> ~/.ssh
chmod 600 ~/.ssh/<your_pem_file> - Limits access to file - Necessary
chmod 700 ~/.ssh
- Limits access to folder - Necessary
ssh -i ~/.ssh/<your_pem_file> ec2-user@<AWS_Server_Domain_name>
You’ll get the following screen 🙂 Enjoy coding in AWS !!