How to resume SSH session - Ubuntu / RaspberryPi

最近最左塊 RaspberryPi4 諗住用黎比屋企人做 Media Center
但係就咁放係度做 media center 好似有 D 浪費
所以便安裝左 D tools 黎玩
發現有 D tools run 既時候需要 一些時間
但係當你個 ssh connection 斷左之後… 你在 terminal 上執行既 command 亦都會被 cancel
怎樣才可以 reconnect / resume ssh session 呢?

解決方法十分簡單
我們只需要安裝 screen

sudo apt-get install screen

之後用以下 command 去 ssh 到 raspberrypi / linux 便可

ssh -t <server.domain.name> screen -R

e.g.

ssh -t pi@raspberrypi.local screen -R

Hope you find it useful

Chi Yau
Chi Yau
Software Developer

Interest to share knowledge / experience

comments powered by Disqus

Related