Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[fixed] ssh 127.0.0.1 won't work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
swagr
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2002
Posts: 90
Location: Toronto

PostPosted: Fri Apr 23, 2004 5:36 pm    Post subject: [fixed] ssh 127.0.0.1 won't work Reply with quote

I need to ssh my local machine to do some troubleshooting.
I realize ssh-ing the machine I'm on is a little pointeless otherwise.

Remote machines can ssh the box with no problems, but when I try to do a local ssh (ssh 127.0.0.1) it won't work.

Does it sound I have something misconfigured or does ssh actually do this on purpose?

Thanks for any help.
_________________
RUN!


Last edited by swagr on Fri Apr 23, 2004 10:12 pm; edited 1 time in total
Back to top
View user's profile Send private message
sekretarz
Retired Dev
Retired Dev


Joined: 09 Feb 2004
Posts: 156
Location: Poznan, Poland

PostPosted: Fri Apr 23, 2004 6:41 pm    Post subject: Reply with quote

I can normally ssh localhost. Check two files: /etc/hosts.allow and /etc/hosts.deny
_________________
#gentoo.pl Team - sekretarz
Back to top
View user's profile Send private message
vonhelmet
l33t
l33t


Joined: 06 Apr 2004
Posts: 770
Location: Somewhere in a school

PostPosted: Fri Apr 23, 2004 7:05 pm    Post subject: Reply with quote

sekretarz wrote:
I can normally ssh localhost. Check two files: /etc/hosts.allow and /etc/hosts.deny


I just stumbled across this thread and found I can't ssh into my own box from itself either... And I don't have the hosts.allow and hosts.deny files in etc.
Back to top
View user's profile Send private message
phthalocyanide
n00b
n00b


Joined: 17 Apr 2004
Posts: 6
Location: Somewhere in Canada

PostPosted: Fri Apr 23, 2004 7:15 pm    Post subject: Do you have any netfiltering rules? Reply with quote

Do you have any netfiltering rules?

do this with root privilege:

/sbin/iptables -L

If you have not set any rules, you should get output like this:

Password:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Back to top
View user's profile Send private message
swagr
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2002
Posts: 90
Location: Toronto

PostPosted: Fri Apr 23, 2004 7:53 pm    Post subject: Reply with quote

No iptables rules. No hosts.allow/deny files in etc.

If I ssh verbosely I see that I actually physically connect, but sshd boots me off.

Code:

...
Connecting to localhost [127.0.0.1]
Connection established.
...
ssh_exchange_identification: Connection closed by remote host

_________________
RUN!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54848
Location: 56N 3W

PostPosted: Fri Apr 23, 2004 8:03 pm    Post subject: Reply with quote

swagr,

You may have rootsquash set. ssh in as an unprivilidged user and do su after if needed.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
swagr
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2002
Posts: 90
Location: Toronto

PostPosted: Fri Apr 23, 2004 8:20 pm    Post subject: Reply with quote

This is really odd.
I set up a proxy on another machine that just bounces me straight back.

When I ssh myself that way it works!?

So the stuff going OVER the wire is the same. The only issue here is IP address. It's just that sshd doesn't like it coming from the same machine. So the question is still: why does sshd have a problem?
_________________
RUN!
Back to top
View user's profile Send private message
swagr
Tux's lil' helper
Tux's lil' helper


Joined: 18 Apr 2002
Posts: 90
Location: Toronto

PostPosted: Fri Apr 23, 2004 10:11 pm    Post subject: Reply with quote

FIXED!

Ok as it turns out, sshd was being started from xinetd.
I thought it was started from /etc/init.d/sshd because I'd always see sshd jobs in ps. I figured xinet.d would start/stop sshd as needed. I guess I was wrong.

Anyway, my xinetd.conf specifies the only_from parameter as the network address I'm on but not explicitly localhost or 127.0.0.1.

When I added localhost to the only_from field in xinetd.conf, everything worked fine.

I guess xinetd passes some command-line parameters to ssh that make it boot me off unless it explicitly sees an address allowed in xinetd.conf.
_________________
RUN!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum