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 remotely connect another Linux host under Linux system

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "how to remotely connect another Linux host under the Linux system". In the daily operation, I believe that many people have doubts about how to remotely connect another Linux host under the Linux system. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "how to connect another Linux host remotely under the Linux system". Next, please follow the editor to study!

The function of Mosh

It is a remote terminal program that supports roaming.

Available in all major Unix-like versions, such as Linux, FreeBSD, Solaris, Mac OS X, and Android.

Support for unstable connections

Support for intelligent local echo

Supports row editing entered by the user

Responsive Design and its robustness under wifi, 3G and long distance connection

Stay connected after the IP changes. It uses UDP instead of TCP (used in SSH), and the TCP times out when the connection is reset or after a new IP is obtained, but the UDP remains connected.

Remain connected when the session is resumed after a long time.

There is no network delay. Display user input and deletions immediately without delay

Some of the old ways of logging in are supported like SSH.

Packet loss handling mechanism

Installation of mosh in Linux

On systems like Debian, Ubuntu, and Mint, you can easily install it with the apt-get package manager.

The code is as follows:

# apt-get update

# apt-get install mosh

In RHEL/CentOS/Fedora-based systems, to install mosh using the yum package manager, you need to open a third-party EPEL.

The code is as follows:

# yum update

# yum install mosh

In the version of Fedora 22 +, you need to use the dnf package manager to install mosh.

The code is as follows:

# dnf install mosh

How do I use mosh?

1. Let's try to log in to the remote Linux server using mosh.

The code is as follows:

$mosh root@192.168.0.150

Note: do you see a connection error, because I still open this port in CentOS 7. A quick solution that I don't recommend is:

The code is as follows:

# systemctl stop firewalld

[on remote server]

2. Let's assume that the default port 22 is changed to 70, and then use the-p option to use the custom port.

The code is as follows:

$mosh-p 70 root@192.168.0.150

3. Check the version of mosh

The code is as follows:

$mosh-version

4. You can type exit to exit the mosh session.

The code is as follows:

$exit

5. Mosh supports many options, which you can see in the following ways:

The code is as follows:

$mosh-help

Advantages and disadvantages of mosh

Mosh has additional requirements, such as the need to allow UDP to connect directly, which is not needed in SSH.

The dynamically assigned port range is 60000-61000. The first open port is assigned. One port is required for each connection.

Default port allocation is a serious security issue, especially in production environments.

IPv6 connections are supported, but IPv6 roaming is not supported.

Rollback is not supported

X11 forwarding is not supported

Ssh-agent forwarding is not supported

At this point, the study on "how to remotely connect another Linux host under the Linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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