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

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.

Related

How to solve "ssh_exchange_identification: read: Connection reset" error?

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.

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.

EC2 how to swap your elastic IP

I have two instances. They are going to run the same app, but one is set up with a slightly different configuration. Right now I can go to their assigned elasticip and see that my site works on both. Th eonly other difference is that one is a micro instance and one is a small instance. Also, I have a bunch of DNS records pointing my domain name to the ip of the micro instance.
But what I want to do is swap them so that the small instance is now my main instance that has my domain pointing to it. I was hoping I could just disassociate the ip's and then reassociate the ip's only flipped around. But when I do that and then try to go to my domain.com I just get an error page. When I swap them back they both seem to work again. Is there something a more complicated I have to do?
edit:
When I try to SSH I also get all this stuff:
###########################################################
# WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! #
###########################################################
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
d6:ed:23:65:9c:da:0c:1b:2d:94:34:18:4d:68:8f:a5.
Please contact your system administrator.
Add correct host key in /Users/croberts/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/croberts/.ssh/known_hosts:17
RSA host key for 54.183.212.154 has changed and you have requested strict checking.
Host key verification failed.
Something nasty! haha.
The error message is indicating that the remote computer does not match the computer previously recorded in the known_hosts file.
When using ssh, each computer generates a fingerprint and this is recorded against the computer identifier (eg IP Address) that you are using to connect to the remote machine.
If you are switching an Elastic IP address between instances and also using the Elastic IP address to ssh into the instance, then the error quite correctly is warning you that the computer is not the same computer to which you last connected on that address.
You can remove the offending entry from the known_hosts file, or even delete the whole known_hosts file (which admittedly will remove such warnings even if they are legitimate).
You should have no problem swapping the elastic IP from one instance to another. It can take a few minutes to take effect, so make sure that you can reach the correct instance before testing.
You don't describe the error, but if you are using name-based virtual hosts, and are using a different name, that could be one cause. If you restart apache after swapping EIPs, does the problem go away?
Finally, to fix the ssh error, remove the entry from the known_hosts file - if you read the error message, it's on line 17.

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