I know this isn't exactly a programming question, but it popped up in my use of git for programming projects at least. I've got a web server that I use to host my git repos on, but my ubuntu box seems to "lose" the ability to connect to it via SSH. I'll get a "connection refused" error when I try to ssh or use git. Rebooting my local machine will fix the problem, but only temporarily. I can still connect to the web interface just fine, and the problem manifests with other servers as well.

I've been working around it by pulling my changes over to my laptop and pushing from there, but that's sub-optimal as you can imagine. Has anyone seen something like this? I'd be tempted to say it's some kind of IP caching problem, but I can't connect even using the IP address of the server directly...

Running Ubuntu 9.04


2 Answers 2


Could there be an IP address collision with something that don't have ssh and your server? A IP address collision could show this way.

To trouble shoot that, do a arp -an when you just got a failed ssh attempt and arp -an after a successful connection. If you see different mac addresses you have an IP address collision.


"Connection refused" typically means that there's no server at the remote site listening for connections. I suggest checking the log files on the remote host.

  • Unfortunately it's a shared host so I Don't have access to the logs. I can get a "connection refused" on my desktop machine and immediately SSH in from my laptop though, so I'm confident the error's on my end.
    – gct
    Commented Mar 18, 2010 at 23:31

You must log in to answer this question.