5

I have an Ubuntu AWS EC2 instance running in the AWS cloud and in my Windows machine I am using PuTTy to connect to it. The problem with this way is that I just have one terminal CLI to access/edit all my code in EC2 instance, which has many files and folders.

Is there a way where I can connect to AWS EC2 to my Windows machine and access the code in my IDE? Something like Remote desktop connection?

Note: I can't test my code on my local machine because the services that I want to access have only whitelisted my AWS EC2 IP.

dasfdsa
  • 7,102
  • 8
  • 51
  • 93
  • *"The problem with this way is that I just have one terminal CLI to access/edit all my code in EC2 instance"* Why would you not simply create multiple PuTTY sessions? – Michael - sqlbot May 01 '18 at 15:42
  • 1
    @Michael-sqlbot I have been doing that. But don't you think its slow and tedious to do it this way? – dasfdsa May 01 '18 at 15:47
  • Honestly, no. That's exactly how I do it... although, for the past several weeks, I have been using [Ubuntu under WSL on Windows](https://learn.microsoft.com/en-us/windows/wsl/about) and it's been a very pleasant surprise how well everything actually works -- my code is running locally with essentially no issues (other than utilities I've written that require certain low level access to things that simply aren't there). You might also find [AWS Cloud9](https://aws.amazon.com/blogs/aws/aws-cloud9-cloud-developer-environments/) interesting, if you haven't seen it. – Michael - sqlbot May 01 '18 at 16:05

2 Answers2

13

Step 1: Open a ec2 Ubuntu terminal using a PuTTY. Refer for more detail how to connect your Linux instance from Windows using PuTTY https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/putty.html

Step 2: Run the following commands on PuTTY Ubuntu terminal step by step

sudo apt update

Install xrdp to allow RDP connections:

sudo apt install ubuntu-desktop

sudo apt install xrdp

Set a password for the ubuntu user:

sudo passwd ubuntu

Step 3:

  • Go to AWS console (EC2 Dashboard)
  • Click on Instances(running)
  • Select your running Ubuntu instance
  • Go to Security
  • Click on Security Groups
  • Click on Edit inbound rules
  • In type drop down select RDP
  • It by default select port 3389
  • In Source add 0.0.0.0/0 IP
  • Click on Save rules

Step 4:

  • Open Remote Desktop Connection on windows machine
  • Enter Computer: Public IPv4 DNS of Ubuntu ec2 and add username:your_user_name
  • click on connect will open up GUI version of Ubuntu (linux), It ask for password please enter the set password.
0

You can use VNC for that purpose https://medium.com/@Arafat./graphical-user-interface-using-vnc-with-amazon-ec2-instances-549d9c0969c5

Venkat Rao
  • 173
  • 1
  • 10