Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to AWS EC2 instance through remote desktop

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.

like image 861
dasfdsa Avatar asked Feb 17 '26 23:02

dasfdsa


1 Answers

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.
like image 196
Abhijit Manepatil Avatar answered Feb 21 '26 13:02

Abhijit Manepatil