Home  >  Article  >  Operation and Maintenance  >  How to remotely connect linux to other linux

How to remotely connect linux to other linux

angryTom
angryTomOriginal
2019-11-05 11:18:239075browse

How to remotely connect linux to other linux

How to remotely connect linux to other linux

1. Install sshd service on other Linux machines

If you are using a series of linux distributions such as redhat, fedora, centos, etc., then type the following command:

sudo yum install sshd 或
sudo yum install openssh-server

If you are using a series of linux such as debian, ubuntu, linux mint, etc. distribution, then type the following command:

sudo apt-get install sshd 或
sudo apt-get install openssh-server

and then follow the prompts to install.

2. Start the sshd service

service sshd start

The preparation work is complete. Here is how to connect.

3. SSH to connect other Linux machines

ssh root@ip -p 22

ip is the ip address of other Linux, -p is the port specified by other Linux sshd service, the default is 22

After pressing Enter, you will be prompted whether to continue the connection. Enter yes, and press Enter. Then enter the password of the root user on other Linux machines to log in successfully.

Note: The root user cannot log in successfully and needs to make the following settings on other Linux machines:

Edit the ssh configuration file

sudo vi /etc/ssh/sshd_config

Find and adjust PermitRootLogin and set it The parameter value is yes;

then restart the service service sshd restart.

Recommended learning: Getting started with linux

The above is the detailed content of How to remotely connect linux to other linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Linux port is blockedNext article:Linux port is blocked