Re: when is the host's name not localhost ??
From: Mishka (mishka@terabyte.com.ua)
Date: 02/13/03
- Next message: Dr. David Kirkby: "Re: when is the host's name not localhost ??"
- Previous message: Dave Uhring: "Re: when is the host's name not localhost ??"
- In reply to: Dr. David Kirkby: "when is the host's name not localhost ??"
- Next in thread: Dr. David Kirkby: "Re: when is the host's name not localhost ??"
- Reply: Dr. David Kirkby: "Re: when is the host's name not localhost ??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: Mishka <mishka@terabyte.com.ua> Date: Thu, 13 Feb 2003 13:14:35 +0200
On Thu, 13 Feb 2003 09:48:25 +0000
"Dr. David Kirkby" <drkirkby@ntlworld.com> wrote:
> I have a Sun SPARCstation 20, with a hostname of 'blackbird'. The
> machine seems to accept ssh connections to localhost, but not if
> called by its hostname blackbird. The machine is running NetBSD 1.6.
>
> [ snip ]
>
> Typing:
>
> $ ssh -vvv blackbird (while on blackbird's, console I see:)
> OpenSSH 3.4 ...
> debug1: reading configuration data /etc/ssh/ssh_config
> debug1: Rhost Authentication disabled, originating port will not be
> trusted.
> debug1: ssh_connect: needpriv 0
> debug1: Connecting to blackbird (192.168.0.103) port 22
> ssh: connect to address 192.168.0.103 port 22; Connection refused.
>
> (doing the same to localhost, I don't see the last line with
> 'Connection refused.' but instead see 'Connection established').
>
> [ snip ]
>
> /etc/hosts has in it:
>
> ::1 localhost
> 127.0.0.1 localhost
> 192.168.0.103 blackbird blackbird.localdomain loghost
> 192.168.0.100 sparrow
First, just in such situations, please run "netstat -an". This will
displays all socket connections, including servers. In you case the
following line should be displayed:
tcp 0 0 127.0.0.1.22 *.* LISTEN
This means you accept connections on localhost only. Then, check your
/etc/ssh/sshd_config file for directives "ListenAddress" and "Port".
Again, I think in you case both looks like
Port 22
ListenAddress 127.0.0.1
Just change "127.0.0.1" to "0.0.0.0" or even comment out both (this
assume sshd will listen on any address, port 22)
>
> Attempting this as has root fails in the same way (despite the fact I
> tried hacking the configuration file to allow root access).
This naturally wasn't good idea. For interactive logins use su(8)
command, but for non-interactive the key-based access is best choice.
> Just to ensure the /etc/ssh/ssh_config file was not badly configured,
> I copied one from a Sun workstation running Solaris 9, which uses
> OpenSSH too. I had to remove 3 lines, as the NetBSD's version of
> OpenSSH complained about these lines in the Sun's configuration file,
> but apart from that, they were then identical.
>
> Any thoughts why this machine will not allow remote ssh connections,
> or connections to itself unless called localhost?
Another thing is add following line to /etc/hosts:
127.0.0.1 blackbird
For future reading refer to netstat(1), sshd(8), tcp(4) and referals on
these pages.
-- BR, Mishka.
- Next message: Dr. David Kirkby: "Re: when is the host's name not localhost ??"
- Previous message: Dave Uhring: "Re: when is the host's name not localhost ??"
- In reply to: Dr. David Kirkby: "when is the host's name not localhost ??"
- Next in thread: Dr. David Kirkby: "Re: when is the host's name not localhost ??"
- Reply: Dr. David Kirkby: "Re: when is the host's name not localhost ??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|