How to solve "ssh_exchange_identification: read: Connection reset" error? - amazon-web-services

I wrote the following command in CMD:
ssh ec2-user#01.01.001.001 -i node.pem
I receive this error:
ssh_exchange_identification: read: Connection reset
I am hosting a website on my Windows Laptop using an Amazon EC2 instance.
How can I get rid of this error?

I can't comment your question due to my low rep to have some further details so I give this a try.
There could be a lot of reasons for this to happen:
the IP is wrong; I suppose that the one you wrote is a fake one. If
it's not, go to your EC2 panel to check the correct one;
the username is wrong; on ubuntu servers you should use ssh ubuntu#ip-address
the server is not reachable for some reason: bad security group
configuration (is the port 22 open?), firewall on your
network/computer...
You can add the flag -vvv to your ssh command to have a very verbose log of your connection so it will we easier to debug.

Related

Unable to connect after setting up tunnel to lightsail instance PHPMyAdmin

After setting up my lightsail instance I tried to follow the instructions at bitnami
I used the ssh -N -L 8888:127.0.0.1:80 -i file.pem bitnami#ip to connect.
I get the expected result with nothing returned in the terminal. Now when I try to visit 127.0.0.1:8888/phpmyadmin I get an error from FF saying unable to connect. I have also tried switching the port to 433 incase that was the issue and visited 127.0.0.1:8443/phpmyadmin and still no luck.
another post suggested I add a slash at the end, that didnt work either. I have turned of my local apache server on my ubuntu machine as I felt that would help yet no show.
I have also ensured I didnt accidentally close the terminal
Any ideas ?
The issue seemed to be that the key file didnt have the right permissions.Once I corrected the permissions as specified in the docs I was able to connect but so far have got the https connection to work and just use http which is less than ideal

Trying to log in my EC2 server, but port 22 : connection refused

I don't know what's wrong with it. Here is a screenshot.
(first image is what i've done in terminal to log in my EC2 server
second image is what i've set in "System preference --> sharing --> remote login)
Yosemite is my OS. Please help me,
Assuming that you have the right key file, you could be running into some security settings issues. Check your security group and make sure that the server is accepting connections on port 22 from all addresses. Also, I generally use the IP address when SSHing into an EC2 box instead of a url, as it is much shorter and more concise. Also, make sure that your server is running Ubuntu. I know that different OS's on EC2 use different default usernames.
Your default username can be found at this page:
http://alestic.com/2014/01/ec2-ssh-username
In the end, your ssh command should be something like
ssh -i otkey.pem [username for your os]#[ip of your box]
Hope this helps!
You've got the right command for an ubuntu server. Check to make sure that security groups are configured and that you don't have Network Access Control Lists configured on your VPC. The configuration you made to the settings of your laptop are to open it up for people to log into your laptop, they don't do anything to facilitate you connecting out.

using Boto How to connect to SSH client using proxy server inbetween?

Instead of directly connecting to SSh client I have to connect using proxy server and then to ssh client?
I have tried below approach:
in Boto\manage\cmdshell.py I have made below change
while retry < 5:
try:print "connecting ssh client"
proxy = paramiko.ProxyCommand('connect-proxy -S my_proxy_IP:8080')
self._ssh_client.connect(self.server.hostname,
username=self.uname,
pkey=self._pkey,sock=proxy)
which is giving me
File "C:\Python27\lib\site-packages\paramiko\transport.py", line 465, in start_client
raise e
paramiko.SSHException: Error reading SSH protocol banner
I referered this link here in stackoverflow
Paramiko Error: Error reading SSH protocol banner
where they are saying
answer is
This issue didn't lie with Paramiko, Fabric or the SSH daemon. It was simply a firewall configuration in ISPs internal network. For some reason, they don't allow communication between different subnets of theirs.
We couldn't really fix the firewall configuration so instead we switched all our IPs to be on the same subnet.
but in my case my host is amazonaws instance what should i do in that case.
I am doing anything wrong here or how can i ovecome this issue.
Fabric has this available as an option by default since version 1.5, documented here. If you're unable to use Fabric, you might then crib from it's source a better solution for yourself.

filezilla Connection timed out

This might seem like a duplicate question but it is not. I tried to go through similar questions but I couldn't find a fix for my problem. Here is my problem:
I need to set up an ftp connection on company servers.
I can easily connect to ftp server from fileZilla on my PC but when I try it over one of the server machines to the file server all I see is the following:
Response: fzSftp started
Command: open "*****#***.***.***.**" **
Error: Connection timed out
Error: Could not connect to server
Status: Waiting to retry...
Status: Connecting to ***.***.***.**...
Response: fzSftp started
Command: open "*****#***.***.***.**" **
Error: Connection timed out
Error: Could not connect to server
I googled the "Connection timed out"
error and I realized that the first place to check is firewall or router setting. these are outsourced to another company and they say that the issue is solved and it should work fine. I don't know where to look at.
I've had lots of issues with Filezilla. You may try another software first to see if Filezilla itself is the issue.
If you're on Windows, I highly suggest the open source project WinSCP (https://winscp.net/eng/download.php). For Mac, Cyberduck (https://cyberduck.io/?l=en) is solid (and free), though you may prefer Transmit.
I was having this problem after upgrading Filezilla. I downgraded it to a previous version and it worked like charm. I came across this ticket thread and it was absolutely helpful : Filezilla Support Ticket
Check your security group rules. You need a security group rule that allows inbound traffic from your public IP address(Google: What is my ip?) on the proper port.
Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
In the navigation pane, choose Instances, and then select your instance.
In the Description tab, next to Security groups, choose view rules to display the list of rules that are in effect.
For Linux instances: Verify that there is a rule that allows traffic from your computer(public ip) to port 22 (SSH).
For Windows instances: Verify that there is a rule that allows traffic from your computer(public ip) to port 3389 (RDP).
Also take a look at here and here for more details
I need to set up an ftp connection on company servers. I can easily connect to ftp server from fileZilla on my PC but when I try it over one of the server machines to the file server all I see is the following:
<failure to connect code>
Please note that public IP and internel IPs will be a different address; such as 123.456.675.574 for the public but internal to the server network it will be something more like 192.168.10.574 .
This is why you can easily connect from your PC because it uses the public IP address but from the internal IP network of the company servers that address will not be valid, and the internal one would need to be used instead.
Try this, 200 is just an example, just increase it and try.
Edit --> Settings --> Connection --> Timeout in seconds = 200

ssh: connect to host heroku.com port 22: No route to host

Hi I in an attempt to connect to more than one heroku account I did a number of stuff that has led to this error. "ssh: connect to host heroku.com port 22: No route to host" I dont know what the problem is or how to solve it so I want to start all over with heroku and ssh keys on my machine. How to I delete the present configurations and start afresh?
A few things I would attempt to do:
Ensure that there is no quirky setup in your HOSTS (/etc/hosts) file that is causing confusion
Check your ~/.ssh directory and ensure that the keys you expect to be there ... are there.
Check your ~/.ssh/config file for any incorrect information
Ensure that your heroku SSH server is actually listening on port 22. A lot of people will change the default SSH port for security purposes.
Ensure that the private key that you're attempting to use is uploaded to the heroku server. Some SSH instances won't tell you that it's an invalid key for security purposes. Instead it will just give you the rejection message you mentioned.
If I think of any other diagnostics I'll be sure to update.
Best of luck.
Perhaps something is set oddly in your $HOME/.ssh/config file. You can try backing up this file and then removing it to see if it resolves your problem.