Protect a SSH access from disconnections
by
Pierre-Yves Landuré
—
last modified
Nov 27, 2015 11:27
By default, a SSH session is closed in case of unexpected disconnect, automatically killing any software being run by it. This howto use the byobu tool to automatically detach a shell in case of disconnect, and reattach it at the next login.
This howto is tested on:
- Debian 7.0 Wheezy
Parameters
Provide the username to protect (used to connect with SSH):
USERNAME="remote-user"
Installation
Environment preparation
Install the needed software:
command apt-get install byobu
Setup
Enable the tool for the protected user:
command su "${USERNAME}" -c "command byobu-launcher-install"
The next remote session of the protected user will be automatically restored in case of unexpected disconnection.
Thanks
- Thanks to repliers to Use GNU screen as login “shell" (en).
- Thanks to Byobu (en) developers.