View previous topic :: View next topic |
Author |
Message |
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6639 Location: The soundosphere
|
Posted: Wed Jun 23, 2021 11:03 pm Post subject: Keep ssh session active over tmux + no internet [SOLVED] |
|
|
My situation: I live in the country and have no broadband - no DSL, no cable, no FIOS. So anything done online on a computer is either because I go out for WiFi or use my hotspot.
What I need to do: Find a way to ssh to my server (easy enough), and then once logged in, chroot into a stage4 and be able to detach from it (not so easy).
The issue is that once I turn off my hotspot, there is no longer a connection from my laptop and even with tmux the connection doesn't stay active. I just need that remote chroot process to remain active to run world updates. My phone can't sit next to my laptop all the time as I need it elsewhere.
I could really use some advice on this. _________________ decibel Linux: https://decibellinux.org
Github: https://github.com/Gentoo-Music-and-Audio-Technology
Facebook: https://www.facebook.com/decibellinux
Discord: https://discord.gg/73XV24dNPN
Last edited by audiodef on Thu Jun 24, 2021 2:24 pm; edited 1 time in total |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Wed Jun 23, 2021 11:48 pm Post subject: |
|
|
Where are you running tmux?
I run tmux on a remote system. Within tmux, I have many windows, often including a chroot. I lose a connection to that remote system regularly. When I do, I ssh back to the remote system, reconnect to the tmux session. Within the tmux session, all windows remain as they were. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6639 Location: The soundosphere
|
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Thu Jun 24, 2021 12:21 am Post subject: |
|
|
I think it might be wrong for the situation you described.
There may be a benefit to running tmux locally too, but I think the primary benefit is to run tmux where the job is being run that you don't want to die. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
Ralphred Guru
Joined: 31 Dec 2013 Posts: 499
|
Posted: Thu Jun 24, 2021 1:05 am Post subject: |
|
|
I do the same with screen instead of tmux, I do it all the time so I can reboot my admin machine without breaking package updates etc.
If your connection drops out, when it comes back reconnect to the ssh terminal, then to the screen session running in the background with screen -x. It does different "windows" too, but I've never got that far into it's controls. |
|
Back to top |
|
|
audiodef Watchman
Joined: 06 Jul 2005 Posts: 6639 Location: The soundosphere
|
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 2964 Location: Edge of marsh USA
|
Posted: Fri Jun 25, 2021 3:47 am Post subject: |
|
|
Ralphred wrote: | I do the same with screen instead of tmux, I do it all the time so I can reboot my admin machine without breaking package updates etc.
If your connection drops out, when it comes back reconnect to the ssh terminal, then to the screen session running in the background with screen -x. It does different "windows" too, but I've never got that far into it's controls. |
I also use screen on the destination ssh shell. Just "screen" with no switches starts the session. Within screen "Ctrl/a d" detaches from the screen you are using. "screen -r" will resume it. I guess it's worked so well, I never got as far as "screen -x" reading the manual. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
Ralphred Guru
Joined: 31 Dec 2013 Posts: 499
|
Posted: Fri Jun 25, 2021 4:21 am Post subject: |
|
|
[quote="figueroa"] Ralphred wrote: | I guess it's worked so well, I never got as far as "screen -x" reading the manual. |
Oh, that's because I use -x for remote support, you can have multiple users using the same "screen" that way. I just defaulted to using it to re-connect, muscle memory habit. |
|
Back to top |
|
|
|