Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use byobu to reuse SSH sessions in linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to use byobu to reuse SSH sessions in linux. It is very detailed and has a certain reference value. Friends who are interested must read it!

Byobu allows you to maintain multiple terminal windows while keeping the session active, connecting, disconnecting, reconnecting, and sharing access through SSH.

Byobu is a text-based window manager and terminal multiplexer. It is similar to GNU Screen, but more modern and intuitive. It also applies to most Linux, BSD, and Mac distributions.

Byobu allows you to maintain multiple terminal windows, connect through SSH (secure shell), disconnect, reconnect, and even allow others to access while keeping the session active.

For example, if you SSH into a raspberry pie or server and run (for example) sudo apt update & & sudo apt upgrade, and then you lose your Internet connection while it is running, your commands will be lost and invalid. However, if you start the byobu session first, it will continue to run, and after you reconnect, you will find that it is still running.

The name Byobu comes from the Japanese decorative multi-panel screen, which can be used as a folding partition, which I think is appropriate.

To install byobu on Debian/Raspbian/Ubuntu:

Sudo apt install byobu

Then enable it:

Byobu-enable

Now, please exit the SSH session and log in again, and you will log in in the byobu session. Run a command like sudo apt update and close the window (or enter the escape sequence (Enter + ~ +.) and log in again. You will see that the update command is still running after you leave.

There are a lot of features that I don't use very often. What I usually use is:

F2-New window

F3/F4-navigate between windows

Ctrl+F2-split the pane vertically

Shift+F2-split pane horizontally

Shift+ left Arrow / Shift+ right Arrow-navigate between split panes

Shift+F11-enlarge (or zoom out) the split pane

How do we use byobu

Byobu is good for maintaining piwheels, a convenient, precompiled Python package for raspberry pie. I split the pane horizontally, showing the piwheels monitor in the top half and the syslog entry in the lower half in real time. Then, if we want to do something else, we can switch to another window. This is especially convenient when we do collaborative analysis, because when I'm chatting in IRC, I can see what my colleague Dave typed (and correct his typos).

I enabled byobu on my home and office servers, so when I log on to any computer, everything is the same as when I left. It is running multiple jobs, leaving a window in a specific directory, running processes as another user, and so on.

Byobu screenshot

Byobu is also convenient for developing on raspberry pie. You can start it on your desktop, run the command, then SSH in, and connect to the session where the command is running. Note that enabling byobu does not change the functionality of the terminal initiator. Just run byobu to start it.

The above is all the content of the article "how to use byobu to reuse SSH sessions in linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report