How to make screen sessions survive ssh disconnect

Hi All,

Just for the record, two steps are needed:

sudo loginctl enable-linger

then add this line to your .bashrc or .zsh:

alias screen='systemd-run --scope --user screen'

(or tmux, clearly)

taken from

I checked it works.

While we appreciate your willingness to contribute, at first glance this does not (yet) meet forum quality standards for a Tutorial.

Your post has been moved from the Tutorials category for the time being, or until Community leaders can scrutinize your submission further.

Regards.