From owner-freebsd-questions@FreeBSD.ORG Mon Dec 20 20:18:00 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFC26106564A for ; Mon, 20 Dec 2010 20:18:00 +0000 (UTC) (envelope-from gull@gull.us) Received: from mail-ew0-f51.google.com (mail-ew0-f51.google.com [209.85.215.51]) by mx1.freebsd.org (Postfix) with ESMTP id 7F2678FC12 for ; Mon, 20 Dec 2010 20:18:00 +0000 (UTC) Received: by ewy19 with SMTP id 19so1766341ewy.10 for ; Mon, 20 Dec 2010 12:17:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.14.123.68 with SMTP id u44mr3087157eeh.21.1292876279290; Mon, 20 Dec 2010 12:17:59 -0800 (PST) Received: by 10.14.127.4 with HTTP; Mon, 20 Dec 2010 12:17:59 -0800 (PST) X-Originating-IP: [69.91.158.201] In-Reply-To: <894762.38692.qm@web114415.mail.gq1.yahoo.com> References: <894762.38692.qm@web114415.mail.gq1.yahoo.com> Date: Mon, 20 Dec 2010 12:17:59 -0800 Message-ID: From: David Brodbeck To: Josh Suid Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: ssh interactive session, through intermediate hosts ... problems ... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Dec 2010 20:18:01 -0000 On Fri, Dec 3, 2010 at 4:43 PM, Josh Suid 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.