Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Keep ssh session active over tmux + no internet [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Wed Jun 23, 2021 11:03 pm    Post subject: Keep ssh session active over tmux + no internet [SOLVED] Reply with quote

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
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Wed Jun 23, 2021 11:48 pm    Post subject: Reply with quote

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
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Wed Jun 23, 2021 11:55 pm    Post subject: Reply with quote

Wait a minute... I get the feeling I'm using tmux wrong. I'm guessing what I *should* be doing is ssh into my server, start tmux there, then detach.
_________________
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
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20067

PostPosted: Thu Jun 24, 2021 12:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 499

PostPosted: Thu Jun 24, 2021 1:05 am    Post subject: Reply with quote

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
View user's profile Send private message
audiodef
Watchman
Watchman


Joined: 06 Jul 2005
Posts: 6639
Location: The soundosphere

PostPosted: Thu Jun 24, 2021 2:23 pm    Post subject: Reply with quote

pjp wrote:


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.


This is what I meant, and that's what I figured out, thanks to your pointing me in the right direction. :)
_________________
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
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2964
Location: Edge of marsh USA

PostPosted: Fri Jun 25, 2021 3:47 am    Post subject: Reply with quote

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
View user's profile Send private message
Ralphred
Guru
Guru


Joined: 31 Dec 2013
Posts: 499

PostPosted: Fri Jun 25, 2021 4:21 am    Post subject: Reply with quote

[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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum