How do I tap into an SSH session?

Let’s say I start an SSH session on my laptop and have things going but have to restart my laptop for some reason, how can I access that session on the DietPi itself?

Like right now I have an install going over SSH on my laptop but want to pick it up on the Dietpi.

Screen

https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/

Exactly, how can I give thumbs on this forum? :smiley:

Screen is absolutely great, must-have from my side. If there wasn’t so much other topics on DietPi dev, I would have added it already, from my side as default. So it’s on my minds list at least.

You can start some long task there, and if your SSH connection breaks or you want to drink coffee, the task will go on and you can reattach at any time.

Only downside was, that you can’t scroll up the terminal output by default with mouse wheel. But I found a solution for this:

cat << _EOF_ > ~/.screenrc
# Make screen windows scrollable
termcapinfo xterm|xterms|xs|rxvt ti@:te@
# Add information status line to screen windows
caption always "%{Gk}DietPi Screen | $LOGNAME@%H | %LD %d.%m.%Y %c | Load: %l | %-Lw%{kG}%n%f*%50> %t%{-}%+Lw%<"
_EOF_

The last line adds some kind of status line. Needs visual tuning, but the ugly code part on the right side actually lists all active screen windows and highlights the one you are attached. So if you want to have e.g. some files open in parallel or parallel running jobs, it helps a bid to keep overview.

Trust me…you would have gotten ALOT by now :smiley:

Agree, @MichaIng valuable, continued code contributions and end user support, does not go unnoticed.

Well deserved, mega thumbs up :smiley:

            _
           /(|
          (  :
         __\  \  _____
       (____)  `|
      (____)|   |
       (____).__|
        (___)__.|_____



            _
           /(|
          (  :
         __\  \  _____
       (____)  `|
      (____)|   |
       (____).__|
        (___)__.|_____



Agree as well.

            _
           /(|
          (  :
         __\  \  _____
       (____)  `|
      (____)|   |
       (____).__|
        (___)__.|_____

dunno about screen but i use:

nohup some_command > output.log &
then i can close the session
to check if the process is still running: jobs -l
or to check status: tail -f output.log