With using amazon free account create ec2 ubuntu instance and access it's GUI using remote desktop.
- Configure Free Tier Ubuntu instance on AWS EC2
- Connect to Ubuntu instance via SSH with PuTTY
- Add GUI options to Ubuntu
- Configure PuTTY to Tunnel RDP traffic
- Test with RDP
- Login to AWS Educate Account.
- Go to the services and click on EC2.
- Click on launch Instance.
- Select an Amazone Machine Image as Ubuntu Server 16.04.
- Choose an instance type t2.micro (Which is free).
- Click on Launch.
- 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).
- Click on Lounch Instance.
- Instance is Launched.
- Now, Click on View Instances.
- You can edit the name of instances.
- For edit the name of instance click on pen sign which is in Name column.
.
- For Download PuTTY open link given below.
-
Now, Download PuTTY installer.
-
After that install PuTTY.
-
Open PuTTYgen.
- Load Keypair file which we have download.(keypair.pen)
- Select key Pair Name file which we have downloaded during step 1 process.(.pen File)
- It will show you only private key (.ppk) files for selecting .pen file select All Files *.
- Save Private key (.ppk file).'
- Open PuTTY.
- Select public IPV4 of instance.
- Give that ip as host.
- Save this session data to any session variable.
- Click on Connection -> SSH -> Auth.
- Browse that private key file which we have generated using PuTTYgen.
- Click on Open.
- Can Use access instance CLI.
-
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
-
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 ]
-
Now, Go to Connections -> SSH -> Auth -> Tunnels.
-
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]