Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just updated my server from Debian 5 to Debian 6 and now when I try to git pull (Or any git command it seems) I get this:

ssh: connect to host bhslaughter.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly

I had set up gitosis as well. Also I'm not sure if its related but when I do ssh localhost I get ssh: Could not resolve hostname localhost: Name or service not known. Same for if I type out 127.0.0.1. SSH is working though, as I'm using it to connect to the server. Any idea whats causing this?

Edit:

My hosts file:

127.0.0.1       bhslaughter.com boslaughter.com ruinvalor localhost localhost.localdomain
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
ff02::3         ip6-allhosts

Edit2:

resolve.conf:

nameserver 173.45.224.5
nameserver 173.45.224.4

nsswitch.conf:

passwd:         compat
group:          compat
shadow:         compat

hosts:          files dns
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
share|improve this question
    
Do you have the IPv4 and IPV6 entries for localhost in the /etc/hosts of the server ? ssh uses DNS and DNS uses the hosts file, and IPv6 disabling, works different from lenny to squeeze. –  poisonbit Apr 17 '11 at 18:19
    
@poisonbit I think so, I posted the contents of my hosts file above –  Telanor Apr 17 '11 at 18:27
    
"Could not resolve hostname localhost" points to some problem on that file... maybe "127.0.0.1 localhost.localdomain localhost" as a first line, then 127.0.1.1 with your other aliases ? loopback network is 127.0.0.0/8 so everything should continue working with this test. –  poisonbit Apr 17 '11 at 18:43
    
What's in your /etc/resolv.conf and the files line of your /etc/nsswitch.conf? –  justarobert Apr 17 '11 at 18:54
    
@poisonbit I made the changes, didnt seem to help. @justarobert: I posted the contents of those two files above –  Telanor Apr 17 '11 at 19:32
show 2 more comments

1 Answer

up vote 0 down vote accepted

I found out what the problem was. iptables was restoring rules before the localhost adapter was initiated. For some reason after the upgrade the rules file became invalid, making the restore fail and causing the localhost adapter to not be loaded.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.