Amazon EC2 instance not able to access via ssh - amazon-ec2

I am not able to access my amazon ec2 instance via ssh using putty and git bash. The webpage that it is linked to is working and I am able to connect to it.
The ec2 instance is a ubuntu machine. All the security rules are set properly. I also found that the instance is not listening on port 22. Maybe that is the problem but then how can I access it without using Putty?
Any and all help will be appreciated.....

Related

EC2 Instance Connect (browser-based SSH connection) doesn't work

Trying to connect Amazon AWS EC2 instance fails.
Platform: Amazon Linux
Connection method: EC2 Instance Connect (browser-based SSH connection)
Error: There was a problem setting up the instance connection
Log in failed.
If this instance has just started up, try again in a minute or two.
Note: I am able to connect via Putty / SSH Client. But same instance can't connect via browser.
When checked network logs in browser's developer tool, see a Status Code: 400 Bad Request for following URL:
https://ec2-instance-connect.us-east-2.managed-ssh.aws.a2z.com/ls/api/tokens
Has anyone ever successfully connected to Amazon Linux EC2 instance from browser.
To test, I just did the following:
Launched an Amazon Linux 2 EC2 instance with the default security group
Clicked "Connect" in the EC2 management console
Selected "EC2 Instance Connect"
Clicked "Connect"
A new browser tab opened and a few seconds later I had a working SSH connection.
I then tried it again with an Amazon Linux (not Amazon Linux 2) instance and got the error:
There was a problem setting up the instance connection
Log in failed. If this instance has just started up, try again in a minute or two.
This is because the EC2 Instance Connect client is only pre-installed on Amazon Linux 2 and Ubuntu 16.04 or later.
You can use EC2 Instance Connect with your ssh client. In case you really need the browse-based connection, your security group must have a rule allowing SSH connections (port 22) from 0.0.0.0/0. Not much secure in my point of view...
This is for AWS Lightsail, I could not use browser to connect via SSS, instead I was able to connect via SSH using macOS terminal. I was able to login via SSH by appending my public key id_rsa.pub contents to the remote authorized_keys file, I used SFTP (Filezilla) to update authorized_keys file. For SFTP connection I downloaded ssh key from Accounts page.

Unable to connect to AWS ubuntu instance by using VNC after creating AMI

I have an Ubuntu instance that I can use ssh(22 port) and vnc(5901~5909) to connect to this instance.
After installing nginx for my application,then I create AMI for backup.
However,I cannot connect to this instance by using VNC after creating AMI ,but using ssh still works.
Does anyone have similar experience? Thanks a lot.

How to use run deck service from local browser using up address?

I have installed rundeck in docker using ec2 instance.
When I run the image and start rundeck. It's fine.
Lynx http:localhost:4440
Us able to show rundeck dashboard.
But, how can I access this rundeck from Windows browser?
I tried using address but connection refused.
In order to access this from outside for your setup, you might have to ensure the following things:
Ensure that host server (ec2) is forwarding ports to the docker container. You should have used -p or -ports when launching the container for this.
Test: From your EC2 instance, you should be able to access: http://localhost:4440
Ensure you have a public IP assigned to your EC2. You should be able to see that from your aws ec2 console: http://console.aws.amazon.com/ec2
Ensure that your security group(s) for that instance has InBound connections to accept 4440 from your IP or rest of the world.
After this, your http://:4440 should work.
I hope I got your question correct.
Let me know how it goes,
Thanks,
Anoop

Changes to iptable blocked all the ports, hence unable to connect to this Amazon EC2 instance through putty

Yesterday I was working on blocking of access to Redis server from out side doing by doing some changes to "iptable" file, unfortunately it blocked all the port which includes port 80 and 22 also, Hence I was unable to connect to EC2 instance from putty. Will you tell me how to resolve this issue.
You will have to do something like this: https://aws.amazon.com/articles/5213606968661598
I hope you are using EBS and not ephemeral storage. You know you could have used EC2 Security Groups instead of iptables, and then you could have easily fixed your mistake.

Can't get Amazon EC2 instance work

I am trying to setup an amazon ec2 instance for first time.
I've created one with ubuntu 10.4, managed to connect to ssh and installed mongodb, mysql, php and apache which need for my proyect(also python but it is already setup).
Then I associated an elastic ip to the instance, but when I try to open the IP, I can't. It gives timeout.
Could it be that the apache root is not where I think it is?(/var/www/)
You need to check the security group that is associated with the instance. Make sure that you open up port 80.
Also make sure that apache is started, and configured to start on boot.
If you're logged in, you should be able to use wget localhost to verify if apache is serving up pages.

Resources