ssh server trouble with wrong hostname
Hey :)
I've just moved a hobby server from a local location to a hosting farm. In
the process, it's changed its network configuration from DHCP to static IP,
and while the specified hostname has always been wrong on the server, it
hasn't given me any problems while the machine was on the local network
(except for Apache errors when starting up, saying that it'd use 127.0.0.1
instead of the defined hostname), but now, with the machine having its own
IP, I can no longer connect to it via SSH. I can ping and visit the Apache
server in my browser, but when i try to open an SSH connection, it just
hangs there, indefinitely.
Is there any way to connect to this machine without having to actually go
back to the hosting camp and logging in locally?
Thanks :)
Re: ssh server trouble with wrong hostname
Daniel Smedegaard Buus wrote:[color=blue]
> Hey :)
>
> I've just moved a hobby server from a local location to a hosting farm. In
> the process, it's changed its network configuration from DHCP to static IP,
> and while the specified hostname has always been wrong on the server, it
> hasn't given me any problems while the machine was on the local network
> (except for Apache errors when starting up, saying that it'd use 127.0.0.1
> instead of the defined hostname), but now, with the machine having its own
> IP, I can no longer connect to it via SSH. I can ping and visit the Apache
> server in my browser, but when i try to open an SSH connection, it just
> hangs there, indefinitely.
>
> Is there any way to connect to this machine without having to actually go
> back to the hosting camp and logging in locally?
>
> Thanks :)[/color]
Well your computer is definitely not finding your server. Would there be
any reason that the SSH port is being blocked? Also, when on the machine
maybe try "ssh localhost" and see if that works. If not you might not of
started sshd correctly.
--
________
David M Lemcoe Jr.
[email]ender@ender.ath.cx[/email]
Roswell, Georgia
Running Ubuntu 8.0.4.1 "Hardy Heron"
Re: ssh server trouble with wrong hostname
Daniel Smedegaard Buus schrieb:[color=blue]
> Hey :)
>
> I've just moved a hobby server from a local location to a hosting farm. In
> the process, it's changed its network configuration from DHCP to static IP,
> and while the specified hostname has always been wrong on the server, it
> hasn't given me any problems while the machine was on the local network
> (except for Apache errors when starting up, saying that it'd use 127.0.0.1
> instead of the defined hostname), but now, with the machine having its own
> IP, I can no longer connect to it via SSH. I can ping and visit the Apache[/color]
What do you mean by "no longer"? Have you ever connected to this server
via SSH?
[color=blue]
> server in my browser, but when i try to open an SSH connection, it just
> hangs there, indefinitely.
>
> Is there any way to connect to this machine without having to actually go
> back to the hosting camp and logging in locally?
>
> Thanks :)[/color]
Do you know, there is an sshd on the server?
What does
telnet <servername> 22
say
What does
ssh -v <servername>
say? You can repeat this with -v replaced by -vv or -vvv.
Maybe you need to setup a correct DNS on your local system?
Maybe you need to delete the hostkey of <servername> in your local
..ssh/knownhosts
Maybe you need to append your local
..ssh/id_dsa.pub
or
..ssh/id_rsa.pub
to
<your_login>@<servername>:.ssh/authorized_keys
(but i think, this point is never reached when the login-process hangs)
If nothing helps, you could have a look at the newsgroup
comp.security.ssh
Good luck
Wolfgang
Re: ssh server trouble with wrong hostname
Wolfgang Meiners wrote:
[color=blue]
> Daniel Smedegaard Buus schrieb:[color=green]
>> Hey :)
>>
>> I've just moved a hobby server from a local location to a hosting farm.
>> In the process, it's changed its network configuration from DHCP to
>> static IP, and while the specified hostname has always been wrong on the
>> server, it hasn't given me any problems while the machine was on the
>> local network (except for Apache errors when starting up, saying that
>> it'd use 127.0.0.1 instead of the defined hostname), but now, with the
>> machine having its own IP, I can no longer connect to it via SSH. I can
>> ping and visit the Apache[/color]
>
> What do you mean by "no longer"? Have you ever connected to this server
> via SSH?
>[/color]
Hi Wolfgang, thanks for replying. Yes, I connected fine to it before the
switch, that's what I meant :) Guess I wasn't too informative.
I also realized there's a -v switch, this gives me:
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to 195.190.149.135 [195.190.149.135] port 22.
debug1: Connection established.
debug1: identity file /home/daniel/.ssh/identity type -1
debug1: identity file /home/daniel/.ssh/id_rsa type -1
debug1: identity file /home/daniel/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
And this is actually a bit annoying, because half an hour ago, I got a
completely different message, where it was hanging at the end, just before
completing the connection.
My sysadmin friend said that it might have something to do with DNS
resolving because the server'd switched from DHCP to a static address with
being updated?
When trying to connect earlier, I rm -rf'ed my ~/.ssh dir as I thought it'd
might help if there were some old files here that maybe collided with
something.
[color=blue][color=green]
>> server in my browser, but when i try to open an SSH connection, it just
>> hangs there, indefinitely.
>>
>> Is there any way to connect to this machine without having to actually go
>> back to the hosting camp and logging in locally?
>>
>> Thanks :)[/color]
>
> Do you know, there is an sshd on the server?
>
> What does
> telnet <servername> 22
> say
>[/color]
Right now,
Trying 195.190.149.135...
Connected to 195.190.149.135.
Escape character is '^]'.
Connection closed by foreign host.
[color=blue]
> What does
> ssh -v <servername>
> say? You can repeat this with -v replaced by -vv or -vvv.
>[/color]
Here's -vvv:
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 195.190.149.135 [195.190.149.135] port 22.
debug1: Connection established.
debug1: identity file /home/daniel/.ssh/identity type -1
debug3: Not a RSA1 key file /home/daniel/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/daniel/.ssh/id_rsa type 1
debug1: identity file /home/daniel/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
[color=blue]
> Maybe you need to setup a correct DNS on your local system?
>[/color]
Not with IP addresses, I assume?
[color=blue]
> Maybe you need to delete the hostkey of <servername> in your local
> .ssh/knownhosts
>[/color]
Well, I deleted all of it earlier, and now I don't have a knownhosts at all.
Edit: I just deleted .ssh again, and connected to a different host, I now
have a known_hosts, and -vvv now only outputs:
OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to 195.190.149.135 [195.190.149.135] port 22.
debug1: Connection established.
debug1: identity file /home/daniel/.ssh/identity type -1
debug1: identity file /home/daniel/.ssh/id_rsa type -1
debug1: identity file /home/daniel/.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host
[color=blue]
> Maybe you need to append your local
> .ssh/id_dsa.pub
> or
> .ssh/id_rsa.pub
> to
> <your_login>@<servername>:.ssh/authorized_keys
> (but i think, this point is never reached when the login-process hangs)
>[/color]
I don't have those. I never ran ssh-keygen or anything to set anything up
before connecting to any servers, I've always been able to just use ssh "as
is", that is, without previous setting up other than an apt-get install.
[color=blue]
> If nothing helps, you could have a look at the newsgroup
> comp.security.ssh
>
> Good luck
> Wolfgang[/color]
Thanks :) And thanks for your time :)
Daniel
Re: ssh server trouble with wrong hostname
Daniel Smedegaard Buus schrieb:[color=blue]
> Wolfgang Meiners wrote:
>[color=green]
>> Daniel Smedegaard Buus schrieb:[color=darkred]
>>> Hey :)
>>>
>>> I've just moved a hobby server from a local location to a hosting farm.
>>> In the process, it's changed its network configuration from DHCP to
>>> static IP, and while the specified hostname has always been wrong on the
>>> server, it hasn't given me any problems while the machine was on the
>>> local network (except for Apache errors when starting up, saying that
>>> it'd use 127.0.0.1 instead of the defined hostname), but now, with the
>>> machine having its own IP, I can no longer connect to it via SSH. I can
>>> ping and visit the Apache[/color]
>> What do you mean by "no longer"? Have you ever connected to this server
>> via SSH?
>>[/color]
>
> Hi Wolfgang, thanks for replying. Yes, I connected fine to it before the
> switch, that's what I meant :) Guess I wasn't too informative.
>
> I also realized there's a -v switch, this gives me:
>
> OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: Applying options for *
> debug1: Connecting to 195.190.149.135 [195.190.149.135] port 22.
> debug1: Connection established.
> debug1: identity file /home/daniel/.ssh/identity type -1
> debug1: identity file /home/daniel/.ssh/id_rsa type -1
> debug1: identity file /home/daniel/.ssh/id_dsa type -1
> ssh_exchange_identification: Connection closed by remote host[/color]
I am not an expert on ssh-server administration. But when i understand
you right, everything worked, when the server was in the same subnet as
the client. Then you changed the IP of the server and with that, the
subnet of the server. I think, you restarted the sshd? Maybe, on the
server machine, you find a file
/etc/hosts.allow
with a line
ALL : PARANOID : deny
in it. You could also have a file
/etc/hosts.deny
with a line
ALL : PARANOID
in it. Maybe you will have to adjust these files, but you should read
the manpages before doing this.
[color=blue]
>
> And this is actually a bit annoying, because half an hour ago, I got a
> completely different message, where it was hanging at the end, just before
> completing the connection.
>
> My sysadmin friend said that it might have something to do with DNS
> resolving because the server'd switched from DHCP to a static address with
> being updated?
>
> When trying to connect earlier, I rm -rf'ed my ~/.ssh dir as I thought it'd
> might help if there were some old files here that maybe collided with
> something.
>[color=green][color=darkred]
>>> server in my browser, but when i try to open an SSH connection, it just
>>> hangs there, indefinitely.
>>>
>>> Is there any way to connect to this machine without having to actually go
>>> back to the hosting camp and logging in locally?
>>>
>>> Thanks :)[/color]
>> Do you know, there is an sshd on the server?
>>
>> What does
>> telnet <servername> 22
>> say
>>[/color]
>
> Right now,
>
> Trying 195.190.149.135...
> Connected to 195.190.149.135.
> Escape character is '^]'.
> Connection closed by foreign host.
>[color=green]
>> What does
>> ssh -v <servername>
>> say? You can repeat this with -v replaced by -vv or -vvv.
>>[/color]
>
> Here's -vvv:
> OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: Applying options for *
> debug2: ssh_connect: needpriv 0
> debug1: Connecting to 195.190.149.135 [195.190.149.135] port 22.
> debug1: Connection established.
> debug1: identity file /home/daniel/.ssh/identity type -1
> debug3: Not a RSA1 key file /home/daniel/.ssh/id_rsa.
> debug2: key_type_from_name: unknown key type '-----BEGIN'
> debug3: key_read: missing keytype
> debug2: key_type_from_name: unknown key type 'Proc-Type:'
> debug3: key_read: missing keytype
> debug2: key_type_from_name: unknown key type 'DEK-Info:'
> debug3: key_read: missing keytype
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug3: key_read: missing whitespace
> debug2: key_type_from_name: unknown key type '-----END'
> debug3: key_read: missing keytype
> debug1: identity file /home/daniel/.ssh/id_rsa type 1
> debug1: identity file /home/daniel/.ssh/id_dsa type -1
> ssh_exchange_identification: Connection closed by remote host
>[color=green]
>> Maybe you need to setup a correct DNS on your local system?
>>[/color]
>
> Not with IP addresses, I assume?
>[color=green]
>> Maybe you need to delete the hostkey of <servername> in your local
>> .ssh/knownhosts
>>[/color]
>
> Well, I deleted all of it earlier, and now I don't have a knownhosts at all.
>
> Edit: I just deleted .ssh again, and connected to a different host, I now
> have a known_hosts, and -vvv now only outputs:
>
> OpenSSH_4.7p1 Debian-8ubuntu1.2, OpenSSL 0.9.8g 19 Oct 2007
> debug1: Reading configuration data /etc/ssh/ssh_config
> debug1: Applying options for *
> debug2: ssh_connect: needpriv 0
> debug1: Connecting to 195.190.149.135 [195.190.149.135] port 22.
> debug1: Connection established.
> debug1: identity file /home/daniel/.ssh/identity type -1
> debug1: identity file /home/daniel/.ssh/id_rsa type -1
> debug1: identity file /home/daniel/.ssh/id_dsa type -1
> ssh_exchange_identification: Connection closed by remote host
>[/color]
Make sure, that .ssh has the right permissions. chmod 600 ~/.ssh should
do the job.
[color=blue]
>[color=green]
>> Maybe you need to append your local
>> .ssh/id_dsa.pub
>> or
>> .ssh/id_rsa.pub
>> to
>> <your_login>@<servername>:.ssh/authorized_keys
>> (but i think, this point is never reached when the login-process hangs)
>>[/color]
>
> I don't have those. I never ran ssh-keygen or anything to set anything up
> before connecting to any servers, I've always been able to just use ssh "as
> is", that is, without previous setting up other than an apt-get install.
>[color=green]
>> If nothing helps, you could have a look at the newsgroup
>> comp.security.ssh
>>
>> Good luck
>> Wolfgang[/color]
>
> Thanks :) And thanks for your time :)
>
> Daniel
>[/color]
Wolfgang
Re: ssh server trouble with wrong hostname
Wolfgang Meiners schrieb:[color=blue]
> /etc/hosts.allow
>
> with a line
>
> ALL : PARANOID : deny
>
> in it. You could also have a file
>
> /etc/hosts.deny
>
> with a line
>
> ALL : PARANOID
>
> in it. Maybe you will have to adjust these files, but you should read
> the manpages before doing this.
>[/color]
man 5 hosts_access
Wolfgang
Re: ssh server trouble with wrong hostname
Wolfgang Meiners wrote:
[color=blue]
> Wolfgang Meiners schrieb:[color=green]
>> /etc/hosts.allow
>>
>> with a line
>>
>> ALL : PARANOID : deny
>>
>> in it. You could also have a file
>>
>> /etc/hosts.deny
>>
>> with a line
>>
>> ALL : PARANOID
>>
>> in it. Maybe you will have to adjust these files, but you should read
>> the manpages before doing this.
>>[/color]
> man 5 hosts_access
>
> Wolfgang[/color]
Cool, thanks for the last two. I'm pretty sure you're right about this. I
also think I may have broken the running sshd on the server, since I can't
even telnet to it atm. I'm gonna have to go back to the server camp next
week and fix it. Well, practice makes perfect ;)
Thanks again,
Daniel :)
Re: ssh server trouble with wrong hostname
David Marshall Lemcoe Jr. wrote:
[color=blue]
> Daniel Smedegaard Buus wrote:[color=green]
>> Hey :)
>>
>> I've just moved a hobby server from a local location to a hosting farm.
>> In the process, it's changed its network configuration from DHCP to
>> static IP, and while the specified hostname has always been wrong on the
>> server, it hasn't given me any problems while the machine was on the
>> local network (except for Apache errors when starting up, saying that
>> it'd use 127.0.0.1 instead of the defined hostname), but now, with the
>> machine having its own IP, I can no longer connect to it via SSH. I can
>> ping and visit the Apache server in my browser, but when i try to open an
>> SSH connection, it just hangs there, indefinitely.
>>
>> Is there any way to connect to this machine without having to actually go
>> back to the hosting camp and logging in locally?
>>
>> Thanks :)[/color]
> Well your computer is definitely not finding your server. Would there be
> any reason that the SSH port is being blocked? Also, when on the machine
> maybe try "ssh localhost" and see if that works. If not you might not of
> started sshd correctly.
>[/color]
Hi David, sorry for not replying - for some reason your post didn't show on
my work news reader. It's here at home, though :)
Thanks for your input,
Daniel :)
Re: ssh server trouble with wrong hostname
Daniel Smedegaard Buus wrote:[color=blue]
> Hey :)
>
> I've just moved a hobby server from a local location to a hosting farm. In
> the process, it's changed its network configuration from DHCP to static IP,
> and while the specified hostname has always been wrong on the server, it
> hasn't given me any problems while the machine was on the local network
> (except for Apache errors when starting up, saying that it'd use 127.0.0.1
> instead of the defined hostname), but now, with the machine having its own
> IP, I can no longer connect to it via SSH. I can ping and visit the Apache
> server in my browser, but when i try to open an SSH connection, it just
> hangs there, indefinitely.
>
> Is there any way to connect to this machine without having to actually go
> back to the hosting camp and logging in locally?
>
> Thanks :)[/color]
Hi, Daniel.
Have you talked to the farm admin about making sure they allow port 22
through and map it to your machine?
And as soon as you get access, change the SSH port to a 4 or 5 digit
port number! Unless you really like DOS and cracking attempts 24x7 that
is :|
Look for the file sshd_config and the Port= entry, change it to your
chosen port, then restart sshd.
You will have to co-ordinate the port number with the hosting site so
it's passed through to your machine.
--
----------------------------------------------------
Pat Welch, UBB Computer Services, a WCS Affiliate
SCO Authorized Partner
Microlite BackupEdge Certified Reseller
Unix/Linux/Windows/Hardware Sales/Support
(209) 745-1401 Cell: (209) 251-9120
E-mail: [email]patubb@inreach.com[/email]
----------------------------------------------------