From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C4E7C13832E for ; Sun, 17 Jul 2016 22:30:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 37B69E0B6E; Sun, 17 Jul 2016 22:30:05 +0000 (UTC) Received: from ns1.bonedaddy.net (ns1.bonedaddy.net [70.91.141.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C7261E0B56 for ; Sun, 17 Jul 2016 22:30:03 +0000 (UTC) Received: from ns1.bonedaddy.net (ns1.bonedaddy.net [192.168.1.4]) by ns1.bonedaddy.net (8.14.9/8.14.4) with ESMTP id u6HMU2VT018661 for ; Sun, 17 Jul 2016 18:30:02 -0400 Date: Sun, 17 Jul 2016 18:30:02 -0400 From: Todd Goodman To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] Keep alive within SSH session Message-ID: <20160717223002.tkes3e3jgwjtqzkq@ns1.bonedaddy.net> References: <1715734.6NlNPddb3V@dell_xps> <2ca11924-b8ee-8e23-5232-57ff36c4eb9c@ramses-pyramidenbau.de> <8916466.PSEHDcn4Ny@dell_xps> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8916466.PSEHDcn4Ny@dell_xps> User-Agent: Mutt/1.6.2 (2016-06-11) X-Archives-Salt: 7801f297-8bc7-4bbd-8660-931498e9beb1 X-Archives-Hash: 5885f9784ddcf21b5ca9c68637d3118e * Mick [160717 12:36]: > On Sunday 17 Jul 2016 16:20:30 Ralf wrote: > > On 07/17/2016 04:02 PM, Mick wrote: > > > I am not sure of the correct approach to achieve a prolonged remote > > > debugging session through SSH and avoid the SSH session timing out. > > > > > > This is what I try to achieve: > > > > > > I login into a router with SSH from my PC. Then I can run certain > > > commands to start and monitor a debugging session in the router. > > > However, if I leave alone the SSH session, it will soon time out. The > > > debugging only runs while the session is live. Exiting the SSH session > > > causes all debug output to be lost. > > > > Take a look at screen or tmux. man screen, man tmux. > > Thank you Ralph, but detaching the *local* terminal process of SSH does not in > any way stop the login session on the router from timing out. > > > > > If I continue to run (router) commands on the terminal, while the > > > debugging is running, the SSH time out is postponed. > > > > you may also want to tweak some timeout options in your sshd_config > > The router login times out unless some command is fed into the login session a > the time. So, I'll need to be able to run commands every so often on the > router shell from within my SSH session (without sitting in front of my PC > terminal of course). The commands 'watch', or 'at' might do it, but I am not > sure if some script is necessary for this. > > -- > Regards, > Mick if you just want something to keep the connection open how about just a simple shell command in a whole loop? e.g., while true; do clear; ps aux | grep whatever; sleep 5; done