Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Dec 2010 12:17:59 -0800
From:      David Brodbeck <gull@gull.us>
To:        Josh Suid <joshsuid@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: ssh interactive session, through intermediate hosts ... problems ...
Message-ID:  <AANLkTimHrsN0S934GBFfPhW12U=81FQFCECffb378g%2B6@mail.gmail.com>
In-Reply-To: <894762.38692.qm@web114415.mail.gq1.yahoo.com>
References:  <894762.38692.qm@web114415.mail.gq1.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Dec 3, 2010 at 4:43 PM, Josh Suid <joshsuid@yahoo.com> wrote:
> First, where on the ssh client command line (see above) can I specify a m=
ore
> liberal timeout value ? =A0Since my interactive session has three or more=
 layers
> of host between it, the whole thing falls apart if even one link slows do=
wn a
> bit... =A0how can I make my ssh sessions more tolerant to timeouts ?

At what point are you seeing timeouts?

I've found many home routers time out idle TCP sessions quite quickly,
so if it's the first jump, you may find enabling ClientAliveInterval
helps.  I find a setting of 300 seconds (5 minutes) is frequent enough
to keep most routers happy.

> Second, how can I construct this session with just a single command ? =A0=
When I
> try this:
>
> ssh user@host ssh user@host2 ssh user@host3
>
> I get this error:
>
> # ssh user@host ssh user@host2
> Pseudo-terminal will not be allocated because stdin is not a terminal.
> Permission denied (publickey,keyboard-interactive).
>
> Is there a way to build this tunnel with a single command ? (an ssh comma=
nd,
> run over an ssh command, run over an ssh command)

Normally when you execute a command over SSH it doesn't allocate a
pseudo-tty, like it normally will for an interactive session.  You
might try passing the -t command to force allocation of a ptty.

Another option would be to use ssh -L to create a tunnel from one host
to another, then running ssh over that tunnel.  This would also work
with scp.  You may run into problems with host keys, though.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimHrsN0S934GBFfPhW12U=81FQFCECffb378g%2B6>