On the EC2 instances interface, select the instance you just created and click Connect

Switch to the Session Manager tab and click Connect

Successfully connect to the instance

Run the command sudo -su ec2-user to switch from user to ec2-user, and have root administrative rights for the instance

Then run the command ping 8.8.8.8 (IP address of Google’s DNS server) to test whether our instance can connect to the outside internet through igw or not
