Unable to connect to newly launched EC2 instance using SSH/HTTP - amazon-web-services

I am trying my hand to learn AWS. I have created an EC2 instance and i am trying to connect to the same using ssh/http. Neither of them seems to work. I have checked the settings of everything that can cause this issue but everything seems to be correct. Please find the screenshots of everything that i have checked.
If you need any other information please let me know because i dont know where i am going wrong.
Any help is highly appreciated.

Modify your NACL to allow SSH traffic inbound.

If you are trying to connect through SSH from Windows OS using putty, try the following,
Convert your .pem file to .ppk using puttygen.exe. Load your private key(.pem) and save the private key as .ppk
Open putty and point to the converted ppk key under Connections->SSH->Auth [private Key for authentication]
Try to connect now using the public DNS. Eg: ec2-user# as you are using AWS Image.
This should work.

Related

GCP VM instance hosted Website showing connectino refused error message

I am trying to fix a website that is hosted on Google Cloud Platform using VM instance. The website is giving me a connection refused error message. I have checked that the firewall rules are set up and are provided to the VM instance.
The VM external IP is static and the same IP is present on both cloud DNS and GoDaddy.
I'm also unable to SSH into the instance.
The SSH screen is stuck here and is not loading any further
I have given the necessary permissions to the instance and the user (Compute Admin, Compute Instance Admin (v1)), but still no luck.
As the instance is created from a custom image, so later, I tried creating another instance with the same config and I was able to SSH from it. So, please find some screenshots attached below if those could be of any help
netstat -a
route -n
df -h
I am new to this so any help to fix the issue and get the website up and running would be highly appreciated.
If it worked at the second attempt (2nd Instance I mean), I suspect that the SSH service hasn't started properly. I would recommend you to check the Serial Port Output, and Accessing into the Instance through the serial port in order to be able to troubleshoot it.
Note that you'll need a user to access through the serial port. If you don't have any user created, you will be able to do so using an startup-script.
Hope this helps!

AWS EC2 closed my port 22

i have a problem, im trying to connect to my instance EC2 with SSH, but say: Connection closed by IP port 22
I was checking all the configuration, im using a Mac with iTerm (also try with terminal) and is not working, looks like AWS EC2 block my Key PEM.
I ask to AWS support, but they said my IP is not block and they dont see any problem...
What I try is open my port 22, enable the remote login, change the permission to my pem.
Also I configure my inbound connection, with the same configuration of another instance and is working.
I was searching for a solution, but I don't have a solution, maybe I can create another instance and move the content to another instance, but I don't know if I can do that?
any information will be helpful
Check that the username was incorrect. On ubuntu instances it should be "ubuntu" and on amazon instances it should be "ec2-user".
You need to check for the following steps in order to connect EC2 from Mac:
First download the pem file used / created at the time of instance creation.
We have a benefit using Linux / Mac over windows as PEM file created can directly be used to connect. For windows we need to convert it into PPK file.
Now change the permission of the file to Read / Write and make sure the file extension is .pem and not .txt
Check the EC2 permission weather the port is being enabled or not using the following sub steps:
Check the Routes Table for port 22 incoming request is allowed or not.
Check the Network Access Control List of the VPC at the subnet weather the incoming request at port 22 is allowed or not.
Check the Security Group of the instance that weather port 22 request is allowed or not.
By default all the incoming request is being Blocked by the AWS. And
we need to enable the port with the corresponding protocol to allow or
not.
If you have no idea then simply you can set the permission to ALL REQUEST to 0.0.0.0/0, this will enable to connect your EC2 to the internet and to your ssh as well.
Hope this helps.
After many days of struggling with this issue i found solution. You just have to stop your instances and de-attach your volumes and reattach them and it will work like charm. Hope it help you out.

No Supported Authentification Methods AWS EC2 Instance with PuTTY

I am a newbie to SSH and want to connect to my AWS EC2 instance using PuTTY to host a Discord bot. I have generated a RSA private key using the EC2 guide and have configured PuTTY as far as importing private keys and entering hostname.
I am pretty sure I entered the information right that I got from EC2. I'm not really sure if I can get log files either. I have seen other issues like this but no one seemed to be using AWS.
Redownloaded the .pem file. Sorry for wasting your time. Thanks

What should be my host name in putty configuration for setting up SSH server?

I am setting up a node.js server on AWS EC2 using putty configurations.There I found to configure putty.I stuck filling the hostname of EC2 in putty.What will be the hostname can anyone Help?
screenshot of putty config :
Note: I have an EC2 instance launched which I have connect with this.
You can give the public ip of your ec2 instance there. which you can find in the aws management console. Attached is the screen-shot for the same.
Let me know if you are not able to connect with this method.
After generating the key .ppk go to SSH-->Auth-->Browse the .ppk key,
save it and load then open.
Log in with ec2-user.
If you want to give a try, we developed an alternative CLI for AWS that makes this much easier: awless.
It should work on Windows too and with awless, you don't need to set either your IP address nor username, just awless ssh i-1234 or awless ssh my-instance-name.
Note that you may also need to add: -i path/to/your/key.pem if the key was not created with awless.

How to connect same AWS EC2 instance from work and home?

I have EC2 instance running in AWS. I can access it using SSH client and private key at work. Now, I want to connect to same instance from home using Ubuntu 18.04 OS. So I copied the private key and tried using SSH commands from ubuntu terminal. But I didn't work and AWS was saying that access is denied.
I am not good with networking and security stuff. Can anyone help me on how I can access my AWS EC2 instance from ubuntu at home?
I managed to get it working finally. I went to the directory location where the key file is stored on Ubuntu terminal and then typed chmod 400 <yourPrivateKey.pem> and hit enter. Nothing happened. Then type SSH command to connect to my AWS EC2 instance. That's it, I got connected. Now, I really don't know what has happened there and how secure it is to connect this way. Any help is much appreciated.
Thanks.