How To Connect To AWS EC2 Ubuntu GUI Using PUTTY From The Windows Machine?

This article includes the steps of creating an Amazon AWS Ubuntu instance, setting up a desktop GUI via PUTTY, and connecting to it via Remote Desktop Connection.

So let’s get started,

We will start by creating an EC2 instance. Go to EC2 Console https://console.aws.amazon.com/ec2/v2/home and Click on Launch instance. Where you will find multiple AMIs, Scroll down and select Ubuntu Server (For testing purpose select Free tier eligible).

Create-EC2Once you select the server, follow further steps, and launch. Make sure while launching download the PEM file as it will need in the future.

Now go to the EC2 dashboard and look for a public IP address and Copy that as we will need for PUTTY configuration, Though you can use Public DNS as well.

EC2-1

We are done with AWS configuration, now open PUTTY and follow a few steps:

  • Add copied IP address in the Host Name field and name the Saved session and save it. Will keep port as it is i.e., 22 as we have only opened the 22 port as we want everything should go through the SSH tunnel; though you can open other ports as well there will be less security.

Connect To AWS EC2 Ubuntu GUI Using PUTTY

Check Out What It Takes To Build A Successful App Here

  • Add SSH (PPK) key by browsing SSH -> Auth -> Private Key file for authentication -> Browse and again go to Session and Save it.
    Note: By default, AWS only provide a PEM file. We need to convert PEM to PPK. You can find multiple online tools for converting this.

Connect To AWS EC2 Ubuntu GUI Using PUTTY

  • Click on Open, and it will prompt a security alert just choose Yes, and you will able to see the command prompt.
    On the command prompt, just log in as Ubuntu, as we have added PPK so it won’t ask for Password.

Connect To AWS EC2 Ubuntu GUI Using PUTTY

  • Once you get logged into the server, you need to follow the below.
    • sudo apt update && sudo apt upgrade
    • sudo sed -i ‘s/^PasswordAuthentication no/PasswordAuthentication yes/’ /etc/ssh/sshd_config – To set login credentials
    • sudo /etc/init.d/ssh restart
    • sudo passwd ubuntu – This will be your login password to ubuntu machine
    • sudo apt install xrdp xfce4 xfce4-goodies tightvncserver
    • echo xfce4-session> /home/ubuntu/.xsession
    • sudo cp /home/ubuntu/.xsession /etc/skel
    • sudo sed -i ‘0,/-1/s//ask-1/’ /etc/xrdp/xrdp.ini
    • sudo service xrdp restart

Note: In between, if this process asks for some kind of choice, then select the local version installed option.

Now, we need to configure the tunnel on PUTTY to the route of the request.

Open PUTTY again and go to the Connection – > SSH -> Tunnels ->

  1. Add Source Port (This could be any in my case I have added 8888).
  2. Add Destination Port – This will be your instance private IP address following with 3389.
  3. Click on Add.

Connect To AWS EC2 Ubuntu GUI Using PUTTY

We Build HIPPA Complaint Telehealth Platform Using AWS Cloud

Once done, now click on the open button and you will see a Command prompt where login Id will be Ubuntu.
Now you can check either we are listening on the same port or not using the following command: netstat -antp

Connect To AWS EC2 Ubuntu GUI Using PUTTY

Now we are done with the setup.

Open Remote Desktop Connection

Add localhost:8888 or 127.0.0.1:8888 and Connect

Connect To AWS EC2 Ubuntu GUI Using PUTTY

You will be asked for a username and password; So username could be Ubuntu and Password will be added by you while installing the command. And Yeah, there you go, We have successfully logged into the Remote server.

coma

Conclusion

In this way can learn, steps of creating an Amazon AWS Ubuntu instance, setting up a desktop GUI via PUTTY, and connecting to it via Remote Desktop Connection. If You have any doubts regarding this article please comment us.

Get a team of Full Stack Developers started within 24 hours

Deepak

Tech Expert

Deepak is a Full-stack developer with around 3 years of experience. He is an expert in building Java integrated web applications, Creating REST APIs with well designed, testable and efficient and optimized code. He is having experience in web technologies like AngularJS, Angular6, JavaScript, etc. He is a Lead developer at Codegrip. He loves to solve technical problems and helping others.

Upcoming Webinar On "How To Achieve Project Success With Your Outsourced Team!"

Register Now

Get in touch for a detailed discussion.

Hear From Our 100+ Customers
coma

Mindbowser helped us build an awesome iOS app to bring balance to people’s lives.

author
ADDIE WOOTTEN
CEO, SMILINGMIND
coma

We had very close go live timeline and MindBowser team got us live a month before.

author
Shaz Khan
CEO, BuyNow WorldWide
coma

They were a very responsive team! Extremely easy to communicate and work with!

author
Kristen M.
Founder & CEO, TotTech
coma

We’ve had very little-to-no hiccups at all—it’s been a really pleasurable experience.

author
Chacko Thomas
Co-Founder, TEAM8s
coma

Mindbowser is one of the reasons that our app is successful. These guys have been a great team.

author
Dave Dubier
Founder & CEO, MangoMirror
coma

Mindbowser was very helpful with explaining the development process and started quickly on the project.

author
Hieu Le
Executive Director of Product Development, Innovation Lab
coma

The greatest benefit we got from Mindbowser is the expertise. Their team has developed apps in all different industries with all types of social proofs.

author
Alex Gobel
Co-Founder, Vesica
coma

Mindbowser is professional, efficient and thorough. 

author
MacKenzie R
Consultant at XPRIZE
coma

Very committed, they create beautiful apps and are very benevolent. They have brilliant Ideas.

author
Laurie Mastrogiani
Founder, S.T.A.R.S of Wellness
coma

MindBowser was great; they listened to us a lot and helped us hone in on the actual idea of the app.” “They had put together fantastic wireframes for us.

author
Bennet Gillogly
Co-Founder, Flat Earth
coma

They're very tech-savvy, yet humble.

author
Uma Nidmarty
CEO, GS Advisorate, Inc.
coma

Ayush was responsive and paired me with the best team member possible, to complete my complex vision and project. Could not be happier.

author
Katie Taylor
Founder, Child Life On Call
coma

As a founder of a budding start-up, it has been a great experience working with Mindbower Inc under Ayush's leadership for our online digital platform design and development activity.

author
Radhika Kotwal
Founder of Courtyardly
coma

The team from Mindbowser stayed on task, asked the right questions, and completed the required tasks in a timely fashion! Strong work team!

author
Michael Wright
Chief Executive Officer, SDOH2Health LLC
coma

They are focused, patient and; they are innovative. Please give them a shot if you are looking for someone to partner with, you can go along with Mindbowser.

author
David Cain
CEO, thirty2give
coma

We are a small non-profit on a budget and they were able to deliver their work at our prescribed budgets. Their team always met their objectives and I'm very happy with the end result. Thank you, Mindbowser team!!

author
Bart Mendel
Founder, Mindworks
coma

Mindbowser was easy to work with and hit the ground running, immediately feeling like part of our team.

author
George Hodulik
CEO, Stealth Startup, Ex-Google