This section covers how to enable key based authentication for RDP session for Desktop Linux Ubuntu 24.04.
To enable key-based authentication and provide an extra layer of security for our RDP session, we can use SSH tunneling and set up port forwarding on the localhost.
Once your instance is up and running, open the command prompt on your local machine and run the command below. Make any necessary changes as applicable.
ssh -i path/to/your/key.pem -L 3390:localhost:3389 ubuntu@vm_ipaddress
provide the path to your key.pem file which you used during the vm deployment. It will ask you for confirmation. Enter yes here.
This will start the tunneling and port will be forwarded to your localhost:3390. Once you are successfully connected to your instance after running the above command, Now open your RDP client from windows machine.
In your RDP client enter the localhost:3390 instead of the public IP of the VM and click connect