Every once in a while you need to keep an application running in an SSH session after you logout.
To be able to logout and log back in later, you’ll need to install an application called “screen”.
To install screen on Ubuntu/Debian type
apt-get install screen in the terminal.
To use screen:
- Start the application by using the command:
- Get the application running how you want it to run and then type
CTRL + A + D to return to the terminal
- Now you can do whatever else you need to in terminal or logout of SSH while your application runs in the background
- To get back to your application, simply log back in via SSH or open terminal again and type
screen -r and your session will come back up
A couple of years ago, I was out having drinks at my then go to bar, Outback Steakhouse. I was pretty friendly with the bartenders and noticed that every time they would cash a customer out, they had to go out of the bar area, run up front, cash them out and come back. I finally asked them what was going on and they told me that their POS at the bar had gone down and it was going to take the vendor a week to come out to fix it.
Me being me, I offered to take a look at it, the manager agreed. I found that it wasn’t booting its operating system (Windows NT) because of a hard drive failure. I decided to take a shot in the dark and run back to my apartment, flash a usb drive with SpinRite, come back to the bar, booted up SpinRite and told them to let it run overnight.
The next day I came in after work and they had already taken the usb drive out and booted up the POS and it worked! They were so grateful that when I would go in there for dinner or drinks for the next month they would comp everything!
So the next time you get a hard drive failure, try running SpinRite on the drive!