4k3or3et
Posts: 137
Joined: Sat Nov 17, 2018 5:47 pm

SSH session disconnected. How to get it back?

Sun May 09, 2021 9:28 am

Hi All,

When i get disconnected for any reason from my SSH session and something is running there, like a long process which gives a lot of outputs, how can re-connect to that same session again? Is it even a thing?

Thank you.

ghans
Posts: 7885
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: SSH session disconnected. How to get it back?

Sun May 09, 2021 9:34 am

Code: Select all

sudo apt install reptyr
repytr PID
The PID can be discovered by

Code: Select all

ps aux | grep PROGRAMNAME
DISCLAIMER: This has never worked for me, in the future just use tmux/screen before getting disconnected.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

User avatar
DougieLawson
Posts: 41309
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: SSH session disconnected. How to get it back?

Sun May 09, 2021 9:56 am

Use screen or tmux. Or if you mean GUI, use VNC.
Any language using left-hand whitespace for syntax is ridiculous

Any DMs sent on Twitter will be answered next month.
Fake doctors - are all on my foes list.

Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Return to “Beginners”