ssh server trouble with wrong hostname - Ubuntu

This is a discussion on ssh server trouble with wrong hostname - Ubuntu ; 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, ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: ssh server trouble with wrong hostname

  1. 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

  2. Re: ssh server trouble with wrong hostname

    Daniel Smedegaard Buus wrote:
    > 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

    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.
    ender@ender.ath.cx
    Roswell, Georgia
    Running Ubuntu 8.0.4.1 "Hardy Heron"

  3. Re: ssh server trouble with wrong hostname

    Daniel Smedegaard Buus schrieb:
    > 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


    What do you mean by "no longer"? Have you ever connected to this server
    via SSH?

    > 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


    Do you know, there is an sshd on the server?

    What does
    telnet 22
    say

    What does
    ssh -v
    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 in your local
    ..ssh/knownhosts

    Maybe you need to append your local
    ..ssh/id_dsa.pub
    or
    ..ssh/id_rsa.pub
    to
    @:.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

  4. Re: ssh server trouble with wrong hostname

    Wolfgang Meiners wrote:

    > Daniel Smedegaard Buus schrieb:
    >> 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

    >
    > What do you mean by "no longer"? Have you ever connected to this server
    > via SSH?
    >


    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.

    >> 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

    >
    > Do you know, there is an sshd on the server?
    >
    > What does
    > telnet 22
    > say
    >


    Right now,

    Trying 195.190.149.135...
    Connected to 195.190.149.135.
    Escape character is '^]'.
    Connection closed by foreign host.

    > What does
    > ssh -v
    > say? You can repeat this with -v replaced by -vv or -vvv.
    >


    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

    > Maybe you need to setup a correct DNS on your local system?
    >


    Not with IP addresses, I assume?

    > Maybe you need to delete the hostkey of in your local
    > .ssh/knownhosts
    >


    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


    > Maybe you need to append your local
    > .ssh/id_dsa.pub
    > or
    > .ssh/id_rsa.pub
    > to
    > @:.ssh/authorized_keys
    > (but i think, this point is never reached when the login-process hangs)
    >


    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.

    > If nothing helps, you could have a look at the newsgroup
    > comp.security.ssh
    >
    > Good luck
    > Wolfgang


    Thanks And thanks for your time

    Daniel


  5. Re: ssh server trouble with wrong hostname

    Daniel Smedegaard Buus schrieb:
    > Wolfgang Meiners wrote:
    >
    >> Daniel Smedegaard Buus schrieb:
    >>> 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

    >> What do you mean by "no longer"? Have you ever connected to this server
    >> via SSH?
    >>

    >
    > 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


    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.


    >
    > 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.
    >
    >>> 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

    >> Do you know, there is an sshd on the server?
    >>
    >> What does
    >> telnet 22
    >> say
    >>

    >
    > Right now,
    >
    > Trying 195.190.149.135...
    > Connected to 195.190.149.135.
    > Escape character is '^]'.
    > Connection closed by foreign host.
    >
    >> What does
    >> ssh -v
    >> say? You can repeat this with -v replaced by -vv or -vvv.
    >>

    >
    > 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
    >
    >> Maybe you need to setup a correct DNS on your local system?
    >>

    >
    > Not with IP addresses, I assume?
    >
    >> Maybe you need to delete the hostkey of in your local
    >> .ssh/knownhosts
    >>

    >
    > 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
    >


    Make sure, that .ssh has the right permissions. chmod 600 ~/.ssh should
    do the job.

    >
    >> Maybe you need to append your local
    >> .ssh/id_dsa.pub
    >> or
    >> .ssh/id_rsa.pub
    >> to
    >> @:.ssh/authorized_keys
    >> (but i think, this point is never reached when the login-process hangs)
    >>

    >
    > 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.
    >
    >> If nothing helps, you could have a look at the newsgroup
    >> comp.security.ssh
    >>
    >> Good luck
    >> Wolfgang

    >
    > Thanks And thanks for your time
    >
    > Daniel
    >


    Wolfgang

  6. Re: ssh server trouble with wrong hostname

    Wolfgang Meiners schrieb:
    > /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.
    >

    man 5 hosts_access

    Wolfgang

  7. Re: ssh server trouble with wrong hostname

    Wolfgang Meiners wrote:

    > Wolfgang Meiners schrieb:
    >> /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.
    >>

    > man 5 hosts_access
    >
    > Wolfgang


    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

  8. Re: ssh server trouble with wrong hostname

    David Marshall Lemcoe Jr. wrote:

    > Daniel Smedegaard Buus wrote:
    >> 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

    > 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.
    >


    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

  9. Re: ssh server trouble with wrong hostname

    Daniel Smedegaard Buus wrote:
    > 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


    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: patubb@inreach.com
    ----------------------------------------------------

+ Reply to Thread