ExitOnForwardFailure, does it work after connection is established? - SSH

This is a discussion on ExitOnForwardFailure, does it work after connection is established? - SSH ; Hi all, I understand that the following command: ssh -o 'ExitOnForwardFailure yes' -L 2525:stmp.company.com:25 gate.company.com -N dies in case it cannot establish a connection and initialize the tunneling. But what if a connection succeeds at first and it breaks later ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: ExitOnForwardFailure, does it work after connection is established?

  1. ExitOnForwardFailure, does it work after connection is established?

    Hi all,

    I understand that the following command:

    ssh -o 'ExitOnForwardFailure yes' -L 2525:stmp.company.com:25
    gate.company.com -N

    dies in case it cannot establish a connection and initialize the
    tunneling. But what if a connection succeeds at first and it breaks
    later on, because I disconnect the network cable for a while?
    Apparently the connection hangs up and anything happens (apart that
    the mail client timeouts). Is there a way to have ssh dieing in such a
    case?

    I would need it for my laptop, when I put it on standby it behaves
    like if the cable is unplugged. My idea is to sort that out by means
    of an infinite loop that launch the above command every 30 secs or so.

    Thanks in advance for any help

    Marco


  2. Re: ExitOnForwardFailure, does it work after connection is established?

    Zak Mc Kracken wrote:
    > Hi all,
    >
    > I understand that the following command:
    >
    > ssh -o 'ExitOnForwardFailure yes' -L 2525:stmp.company.com:25
    > gate.company.com -N
    >
    > dies in case it cannot establish a connection and initialize the
    > tunneling. But what if a connection succeeds at first and it breaks
    > later on, because I disconnect the network cable for a while?
    > Apparently the connection hangs up and anything happens (apart that
    > the mail client timeouts). Is there a way to have ssh dieing in such a
    > case?
    >
    > I would need it for my laptop, when I put it on standby it behaves
    > like if the cable is unplugged. My idea is to sort that out by means
    > of an infinite loop that launch the above command every 30 secs or so.
    >
    > Thanks in advance for any help
    >


    Maybe "ServerAliveCountMax" and "ServerAliveInterval" options ?

    man ssh_config if you want more information about them..

    --
    Martin

  3. Re: ExitOnForwardFailure, does it work after connection is established?

    >
    > Maybe "ServerAliveCountMax" and "ServerAliveInterval" options ?
    >
    > man ssh_config if you want more information about them..
    >

    Great, it works! Thanks a lot!


+ Reply to Thread