ssh time out and cannot reconnect - SSH

This is a discussion on ssh time out and cannot reconnect - SSH ; This has happened twice since I got my new MacPro running Leopard. I can ssh from home to office to start a job. The session would time out, and I cannot ssh into the office computer again. I go into ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: ssh time out and cannot reconnect

  1. ssh time out and cannot reconnect

    This has happened twice since I got my new MacPro running Leopard.

    I can ssh from home to office to start a job.

    The session would time out, and I cannot ssh into the office computer
    again.

    I go into the office, reboot, and i can ssh from home again.

    Any suggestion how to fix this?

    Thanks in advance

  2. Re: ssh time out and cannot reconnect

    On Sat, 2 Feb 2008 15:37:44 -0800 (PST) xngse wrote:

    | This has happened twice since I got my new MacPro running Leopard.
    |
    | I can ssh from home to office to start a job.
    |
    | The session would time out, and I cannot ssh into the office computer
    | again.

    What happens when you try to connect again? Some possible scenarios are:

    1. The new connection attempt also times out, with no connection made.
    ssh: connect to host foo.example.com port 22: Connection timed out

    2. The connection is refused.
    ssh: connect to host foo.example.com port 22: Connection refused

    3. The connection is made, but then dropped for some reason. Various
    messages could result from this.

    | I go into the office, reboot, and i can ssh from home again.
    |
    | Any suggestion how to fix this?

    It sounds more like a networking issue. The office machine may have lost
    its routing table or the gateway changed to a non-operating IP address.
    Before rebooting the office machine the next day, login on the console as
    root and check the routing table using "route -n" to see what it has. Also
    check to see if there are any lame connections and if sshd is listening with
    the command "netstat -antp | fgrep :22" (substitute 22 with whatever port
    you are using if different).

    The office network may have become unreachable, or a firewall may be messing
    with the connections. Try setting ServerAliveInterval to 120 seconds in
    your ~/.ssh/config file on the client machine at home.

    If the problem persists, try running "tcpdump" with appropriate arguments to
    monitor the traffic from home, under the "script" program to log it to a
    file where you can see what happened to the connection (it may, for example,
    still be active on the office machine).

    --
    |---------------------------------------/----------------------------------|
    | Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
    | first name lower case at ipal.net / spamtrap-2008-02-03-0929@ipal.net |
    |------------------------------------/-------------------------------------|

  3. Re: ssh time out and cannot reconnect

    Thanks, I rebooted this morning. Came home at 2pm and can connect
    between 2 and 4. Then it stopped again.

    debug1: Reading configuration data /Users/Jones/.ssh/gmmssh_config
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to computer.abc..edu [xxx.xxx.xx] port 22.
    debug1: connect to address xxx.xxx.xxx port 22: Operation timed out

    I have a static IP and everything was working fine under Tiger (old
    computer).
    Very frustrating. I will do what you suggested tomorrow. The
    Serveralive in ssh is already set at 120.

    I think it has something to do with 2 hours.. I managed to log on for
    two hours


    >
    > What happens when you try to connect again? *Some possible scenarios are:
    >
    > 1. *The new connection attempt also times out, with no connection made.
    > * * ssh: connect to host foo.example.com port 22: Connection timed out
    >
    > 2. *The connection is refused.
    > * * ssh: connect to host foo.example.com port 22: Connection refused
    >
    > 3. *The connection is made, but then dropped for some reason. Various
    > * * messages could result from this.
    >
    > | I go into the office, reboot, and i can ssh from home again.
    > |
    > | Any suggestion how to fix this?
    >
    > It sounds more like a networking issue. *The office machine may have lost
    > its routing table or the gateway changed to a non-operating IP address.
    > Before rebooting the office machine the next day, login on the console as
    > root and check the routing table using "route -n" to see what it has. *Also
    > check to see if there are any lame connections and if sshd is listening with
    > the command "netstat -antp | fgrep :22" (substitute 22 with whatever port
    > you are using if different).
    >
    > The office network may have become unreachable, or a firewall may be messing
    > with the connections. *Try setting ServerAliveInterval to 120 seconds in
    > your ~/.ssh/config file on the client machine at home.
    >
    > If the problem persists, try running "tcpdump" with appropriate arguments to
    > monitor the traffic from home, under the "script" program to log it to a
    > file where you can see what happened to the connection (it may, for example,
    > still be active on the office machine).
    >
    > --
    > |---------------------------------------/---------------------------------- |
    > | Phil Howard KA9WGN (ka9wgn.ham.org) */ *Do not send to the address below |
    > | first name lower case at ipal.net * / *spamtrap-2008-02-03-0...@ipal..net |
    > |------------------------------------/------------------------------------- |



  4. Re: ssh time out and cannot reconnect

    On Sun, 3 Feb 2008 13:11:10 -0800 (PST) xngse wrote:
    | Thanks, I rebooted this morning. Came home at 2pm and can connect
    | between 2 and 4. Then it stopped again.
    |
    | debug1: Reading configuration data /Users/Jones/.ssh/gmmssh_config
    | debug2: ssh_connect: needpriv 0
    | debug1: Connecting to computer.abc..edu [xxx.xxx.xx] port 22.
    | debug1: connect to address xxx.xxx.xxx port 22: Operation timed out
    |
    | I have a static IP and everything was working fine under Tiger (old
    | computer).
    | Very frustrating. I will do what you suggested tomorrow. The
    | Serveralive in ssh is already set at 120.
    |
    | I think it has something to do with 2 hours.. I managed to log on for
    | two hours

    Also try making another connection while the first connection is still
    working to see if there is a connection limit. If the second connection
    cannot be made while the first connection is still working, then it may
    be that once the first connection times out (for whatever reason yet to
    be determined) the server still considers it to be present and does not
    allow another connection. If that is so then two things need to be
    fixed ... the time out and the max connections. However, if the second
    connection can be made, check to see when it times out. Start BOTH ssh
    commands with the "date" command following them on the command line like:

    ssh user@host ; date

    and see if both time out near the same time. Start the second one about
    an hour after the first is started so that if they have a duration of 2
    hours you can easily see that is happening.



    |>
    |> What happens when you try to connect again? ?Some possible scenarios are:
    |>
    |> 1. ?The new connection attempt also times out, with no connection made.
    |> ? ? ssh: connect to host foo.example.com port 22: Connection timed out
    |>
    |> 2. ?The connection is refused.
    |> ? ? ssh: connect to host foo.example.com port 22: Connection refused
    |>
    |> 3. ?The connection is made, but then dropped for some reason. Various
    |> ? ? messages could result from this.
    |>
    |> | I go into the office, reboot, and i can ssh from home again.
    |> |
    |> | Any suggestion how to fix this?
    |>
    |> It sounds more like a networking issue. ?The office machine may have lost
    |> its routing table or the gateway changed to a non-operating IP address.
    |> Before rebooting the office machine the next day, login on the console as
    |> root and check the routing table using "route -n" to see what it has. ?Also
    |> check to see if there are any lame connections and if sshd is listening with
    |> the command "netstat -antp | fgrep :22" (substitute 22 with whatever port
    |> you are using if different).
    |>
    |> The office network may have become unreachable, or a firewall may be messing
    |> with the connections. ?Try setting ServerAliveInterval to 120 seconds in
    |> your ~/.ssh/config file on the client machine at home.
    |>
    |> If the problem persists, try running "tcpdump" with appropriate arguments to
    |> monitor the traffic from home, under the "script" program to log it to a
    |> file where you can see what happened to the connection (it may, for example,
    |> still be active on the office machine).
    |>
    |> --
    |> |---------------------------------------/---------------------------------- |
    |> | Phil Howard KA9WGN (ka9wgn.ham.org) ?/ ?Do not send to the address below |
    |> | first name lower case at ipal.net ? / ?spamtrap-2008-02-03-0...@ipal.net |
    |> |------------------------------------/------------------------------------- |
    |

    --
    |---------------------------------------/----------------------------------|
    | Phil Howard KA9WGN (ka9wgn.ham.org) / Do not send to the address below |
    | first name lower case at ipal.net / spamtrap-2008-02-04-0733@ipal.net |
    |------------------------------------/-------------------------------------|

  5. Re: ssh time out and cannot reconnect

    I think I solved the problem.

    In Leopard, they added a Manually set IP with DHCP in addtiion to the
    Manually set IP as in Tiger.
    The DHCP is screwing things up.
    So far, it is still up and running..

    Thanks!

+ Reply to Thread