Site Tools


start:reattach_ssh

This is an old revision of the document!


On Ubuntu there is a cool feature if you have ssh'd into a computer and are doing a 'sudo do-release-upgrade' and trying to move to the next version via ssh but lose connection, you can then get back to it either by the console of via another new ssh session after reconnecting. On ubuntu you type “sudo screen -D -r” when wanting to get back to that.

This is actually possible for anyone and you can do the same thing on any distro by setting up screen as you login. So for example if you sshe to a server, then just run the command 'screen' first as you login. Now if you ever get disconnected there will be a screen process that you can reattach to anytime. Just log back in either via new ssh session or the console and type 'screen -r' if logged in as the same user, or sudo first if you are not.

Pretty basic and can save you a nightmare if apt-get is waiting for input and gotten stuck mid way through an upgrade or something :)

start/reattach_ssh.1652106039.txt.gz · Last modified: 2022/05/09 14:20 by peter