The Official DevClouds Blogs

logo-devclouds

Connecting to EC2 Virtual Machine

January 11, 2023

Connecting to EC2 Virtual Machine

In this article we’ll learn connecting to EC2 Virtual Machine in AWS instance. if you want to see how to create Virtual Machine in EC2 click the link.

And to do that first of all let me show you the same file that I downloaded previously. if you remember the key pair we created while creating the virtual machine.

pem file

Now it’s in my downloads folder and it’s called darey-ec2.pem. Now I’m we’re gonna need the terminal to do this. So if you’re on a MacOS this is how you’re gonna do it. If you’re on a Windows computer I would show you in another article how to do that.

search terminal

First thing you want to do is on your Mac keyboard you click on the “command” and “spacebar” button. And that’s gonna bring up this search bar you see here that say spotlight search. Type “terminal” and click on terminal to open it up.

Cd Command

Alright we need to go to the downloads folder. Use this command

cd Downloads/

And to see files in there like i want to see my file “darey-ec2.pem”, use this command

ls

Setup EC2 Security Group to access Instance from all over the world.

If you created a new instance in AWS EC2 or you launch your instance without configuring group polices.

Configure Group Polices

In your instance page bring up security group section mentioned above picture with red line.

Security Groups

As you can see this security group right here. Click on that “default” option.

Actions Edit inbound rule

What we need to do is to go to “Actions” then “Edit inbound rule”

Access from Anywhere

Normally you will put an IP address where you want to be able to connect from but in this incident we want to be able to call it from anywhere so select that. If we save this rule we’re pretty much good to go.

Connecting to EC2 Virtual Machine

Connecting EC2

Back to the ec2 instance again and we go to the actions and connect now.

chmod 400

We need to copy and paste to get things to work. Here my key is mention above the picture “chmod 400 darey-ec2.pem”.

ssh Command to connect ec2

After this command use second ssh command to connect to the EC2 Virtual Machine.

Connected to ec2

Whoa did you see that? so right now we are in our EC2 virtual machine. So I’m no longer on my MacOS what this means is I’m currently in a virtual machine running somewhere in AWS datacenter.

Use command “hostname” to check IP address of server.

hostname command

Okay so sit tight and relax before we wrap up this article need to quickly show you how to stop your instance.

Instance State

Okay so if you click on the “Actions” go to “Instance State” here you can use stop button now if you to terminate that instance. If you want to reboot that’s more less like restarting the computer. So while you’re still learning you can just stop and when you need to start learning again you click on the start.

Share This Article

Join our newsletter & get update, It’s That Simple!

Join, Blogs, Discount & Promo code !!!

THERE’S MORE TO READ.

Now that we have our Ubuntu Desktop installed and configured in VirtualBox. I like to show you how to familiarizing yourself with the Linux Terminal.

| January 13, 2023

EC2 as your Virtual Server to take advantage of AWS public cloud solution.

| January 11, 2023

how to download and install Ubuntu Server and configure it.

| January 11, 2023

download and install Ubuntu Desktop and configure one of the Linux distributions called Ubuntu.

| January 11, 2023

Download and install VirtualBox in your PC or your laptop or whatever machine you intend to use.

| January 10, 2023

History of Linux. How Linux actually came and how exactly did he start to exist.

| January 10, 2023

Leave a Reply

Your email address will not be published. Required fields are marked *

Cyber​​Power Cloud, fast, protected virtual servers, instant setup.

Spin up your choice of virtual machine in just 55 seconds.

OVH

Cloud VPS & Dedicated Servers, advanced hosting solutions

Amazon Lightsail provides easy-to-use cloud resources for web applications

Managed Google Cloud Virtual Machines

Easily deploy cloud servers and storage worldwide

Cloud VPS & Dedicated Servers, advanced hosting solutions

Cloud optimized for performance equipped with fast NVMe drives.

AWS

Amazon EC2, the broadest and deepest compute platform

Managing complex cloud infrastructure made easy

High-Performance Cloud Storage Solutions

10 Clouds 1 Panel

Fully managed by our team

All your clouds and dedi's

All your control panels (CP,DA)

All your wordpress sites&plugins

All of that in one CyberPower

Mega control panel

Reliable Co-Location in ISRAEL Service

Buy and add server hardware components to your co-located servers.

Attacked? We Can Defend You!

Advanced DevOps Services

All about us and what we do in cyberpower

Contact us to activate your custom affiliate plan

Terms & Conditions, Privecy Policy