Gentoo Archives: gentoo-user

From: Todd Goodman <tsg@×××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Keep alive within SSH session
Date: Sun, 17 Jul 2016 22:30:15
Message-Id: 20160717223002.tkes3e3jgwjtqzkq@ns1.bonedaddy.net
In Reply to: Re: [gentoo-user] Keep alive within SSH session by Mick
1 * Mick <michaelkintzios@×××××.com> [160717 12:36]:
2 > On Sunday 17 Jul 2016 16:20:30 Ralf wrote:
3 > > On 07/17/2016 04:02 PM, Mick wrote:
4 > > > I am not sure of the correct approach to achieve a prolonged remote
5 > > > debugging session through SSH and avoid the SSH session timing out.
6 > > >
7 > > > This is what I try to achieve:
8 > > >
9 > > > I login into a router with SSH from my PC. Then I can run certain
10 > > > commands to start and monitor a debugging session in the router.
11 > > > However, if I leave alone the SSH session, it will soon time out. The
12 > > > debugging only runs while the session is live. Exiting the SSH session
13 > > > causes all debug output to be lost.
14 > >
15 > > Take a look at screen or tmux. man screen, man tmux.
16 >
17 > Thank you Ralph, but detaching the *local* terminal process of SSH does not in
18 > any way stop the login session on the router from timing out.
19 >
20 >
21 > > > If I continue to run (router) commands on the terminal, while the
22 > > > debugging is running, the SSH time out is postponed.
23 > >
24 > > you may also want to tweak some timeout options in your sshd_config
25 >
26 > The router login times out unless some command is fed into the login session a
27 > the time. So, I'll need to be able to run commands every so often on the
28 > router shell from within my SSH session (without sitting in front of my PC
29 > terminal of course). The commands 'watch', or 'at' might do it, but I am not
30 > sure if some script is necessary for this.
31 >
32 > --
33 > Regards,
34 > Mick
35
36
37 if you just want something to keep the connection open how about just a
38 simple shell command in a whole loop?
39
40 e.g., while true; do clear; ps aux | grep whatever; sleep 5; done