Posts

Showing posts with the label aws

AWS EC2 instance SSH Connection timed out for port 22

Image
In this post I'll describe one of the connectivity issue that I faced while working with AWS EC2 instance. Below is the problem summary, cause and solution. Let's get started... Problem I have created an EC2 Ubuntu Linux instance and configured the same my own. However, I have installed some container application on the same but during the work all of a sudden the SSH connection lost. Now, when I tried to get the connection again , it says- ssh -L 5901:localhost:5901 -I ssh-key.pem ubuntu@ec2-13-xxx-xxx-139.ap-south-1.compute.amazonaws.com connection timeout for port 22 Cause There could be multiple reasons of the same like, inbound rule changes for port 22, firewall turned on, Security group changes etc. In my case it was 'firewall turned on'. Solution So how should I go to turn off the firewall without native ssh connection which I do over terminal/putty?  The answer is through other was utilities like-  Browser based SSH...

AWS EC2 Ubuntu Instance VNC access

Image
In this post I'll write about how to connect to your EC2 Ubuntu linux instance via VNC Viewer app. Let's get started...... Kindly login to your AWS instance via private key through terminal/putty as shown below and follow the steps from 1 to 8 to access your Ubuntu (18.x in my case) GUI from your local machine- ssh -i your-aws-key.pem ubuntu@ec2-x-x-x-80.ap-south-1.compute.amazonaws.com Step-1 sudo apt update &&  sudo apt upgrade Step-2 sudo apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal xfce4 vnc4server Step-3 vncserver Enter the password- xxxx Confirm Password- xxxx Step-4 vi ~/.vnc/xstartup Uncomment previous and use this one in xstartup file as shown below #!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER # exec /etc/X11/xinit/xinitrc unset DBUS_SESSION_BUS_ADDRESS startxfce4 & [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup ...