Skip to content

With using amazon free account create ec2 ubuntu instance and access it's GUI using remote desktop.

Notifications You must be signed in to change notification settings

UMANG2707/EC2-Ubuntu-GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 

Repository files navigation

EC2-Ubuntu-GUI

With using amazon free account create ec2 ubuntu instance and access it's GUI using remote desktop.

3 Steps to connect to the instance.

  1. Configure Free Tier Ubuntu instance on AWS EC2
  2. Connect to Ubuntu instance via SSH with PuTTY
  3. Add GUI options to Ubuntu
  4. Configure PuTTY to Tunnel RDP traffic
  5. Test with RDP

Step 1 Configure Free Tier Ubuntu instance on AWS EC2

  • Login to AWS Educate Account.
  • Go to the services and click on EC2.

2020-04-03 (32)

  • Click on launch Instance.

2020-04-03 (1)

  • Select an Amazone Machine Image as Ubuntu Server 16.04.

2020-04-03 (2)

  • Choose an instance type t2.micro (Which is free).

2020-04-03 (3)

  • Click on Launch.

2020-04-03 (4)

  • Create key pair value if you already have you can choose that exist key pair.
  • Give Key Pair Name.
  • Download that key pair file (Key pair name + .pen).

2020-04-03 (5)

  • Click on Lounch Instance.

2020-04-03 (7)

  • Instance is Launched.
  • Now, Click on View Instances.

2020-04-03 (9)

  • You can edit the name of instances.

2020-04-03 (10)

  • For edit the name of instance click on pen sign which is in Name column.

step 2 Connect to Ubuntu instance via SSH with PuTTY

.

  • For Download PuTTY open link given below.

2020-04-03 (11)

  • Now, Download PuTTY installer.

  • After that install PuTTY.

  • Open PuTTYgen.

2020-04-03 (12)

  • Load Keypair file which we have download.(keypair.pen)

2020-04-03 (13)

  • Select key Pair Name file which we have downloaded during step 1 process.(.pen File)

2020-04-03 (14)

  • It will show you only private key (.ppk) files for selecting .pen file select All Files *.

2020-04-03 (15)

  • Save Private key (.ppk file).'

2020-04-03 (17)

2020-04-03 (18)

step 4 Connect to the instance.

  • Open PuTTY.

2020-04-03 (19)

  • Select public IPV4 of instance.

2020-04-03 (20)

  • Give that ip as host.

2020-04-03 (21)

  • Save this session data to any session variable.

2020-04-03 (22)

  • Click on Connection -> SSH -> Auth.

2020-04-03 (25)

  • Browse that private key file which we have generated using PuTTYgen.
  • Click on Open.

2020-04-03 (26)

  • Can Use access instance CLI.

2020-04-03 (28)

step 3 Add GUI options to Ubuntu

  • Followe given Comands to add GUI option in ubuntu.

  • Check For update and install upgrads run follwing command.

    sudo apt update && sudo apt upgrade

  • We will connecting using windows remote desktop, edit the ssds_config file in your linux instance for allowing password authantication.

    sudo sed -i 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config

  • Restart SSH daemon to make this change.

    sudo /etc/init.d/ssh restart

  • To gain root privileges and set password for ubuntu user for security.

    sudo passwd ubuntu

  • Install xrdp tool for desktop environment (Virtual Network Computer).

    sudo apt install xrdp xfce4 xfce4-goodies tightvncserver

  • Make xfce4 default window manager for Remote Desktop Connection.

    echo xfce4-session$ /home/ubuntu/.xsession
    NOTE: Replace the $ with the Greater Than Sign

  • Copy .xsession to the /etc/skel folder so xfce4 is set as default window manager for any new user account.

    sudo cp /home/ubuntu/.xsession /etc/skel

  • Run sed command to allow changing of the host port you will connect to.

    sudo sed -i '0,/-1/s//ask-1/' /etc/xrdp/xrdp.ini

  • Restar xrdp service.

    sudo service xrdp restart

  • Now, exit from the instance.

    exit

step 4 Configure PuTTY to Tunnel RDP traffic

  • Open PuTTY.

  • Load Session in which we saved information. [ If you have not saved session information then you have to put host name and browse that private key file again ]

    2020-04-03 (22)
  • Now, Go to Connections -> SSH -> Auth -> Tunnels.

    2020-04-03 (37)
  • Give Source port as 8888 and in Destination field give private IPV4 of your instace with addition of : and another port as 3389. [Private IPV4]

2020-04-03 (39)

  • Click on Add.

    2020-04-03 (40)
  • Click on open.

  • Login as ubuntu [If your instance's AMI is ubuntu]

2020-04-03 (28)

  • For checking port is working or not follow given command.

    netstat -antp

    2020-04-03 (43)
  • Remember IPV4 which is in result of above command and source port address.

step 5 Test with RDP

  • Start Remote Desktop from your Windows Operating System.

  • Give IPV4 and source port with (:) seperated and connect.

    2020-04-03 (44)
  • you can use EC2 instance with GUI.

  • Now, Give Username as ubuntu and password which you had set for root privileges.

    2020-04-03 (47)
  • Ready to use..!!

    2020-04-03 (50)

About

With using amazon free account create ec2 ubuntu instance and access it's GUI using remote desktop.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages