Home  >  Article  >  Operation and Maintenance  >  How to implement remote login from linux system to linux server

How to implement remote login from linux system to linux server

王林
王林Original
2019-12-27 09:45:185075browse

How to implement remote login from linux system to linux server

Linux system login to a remote linux server:

There are many different protocols to choose from, maybe SSH is the "best". SSH is the abbreviation of secure shell, which means "secure shell". As a replacement for ancient remote login tools such as rlogin, rcp, and telnet, SSH authenticates the user's identity and encrypts the communication between the two hosts.

The following describes how to use SSH to log in to another Linux server from Linux.

(1) First, install OpenSSH. Use the following command to automatically install OpenSSH:

sudo apt-get install ssh

Free video tutorial sharing: linux video tutorial

(2) Secondly, have a user account of the remote server, here on the server A server user is created here, and its password is set to server, and the /etc/sudoers configuration file is used to temporarily obtain root permissions. As shown below:

How to implement remote login from linux system to linux server

(3) Next, you can log in to the remote Linux server through the following command:

ssh -l login_name hostname

login here -name refers to the user account, hostname refers to the server host name or IP address.

As shown in the picture, the IP address of the server is 192.168.43.80.

How to implement remote login from linux system to linux server

Log in to the linux server:

How to implement remote login from linux system to linux server

In this way, log in to 192.168.43.80This host is gone. When logging in, SSH will ask the user to log in to the server user's password. A key pair is used to log in. SSH will not ask for a password and log in directly by checking the match of the key pair.

When logging in for the first time, SSH may prompt that the authenticity of the key cannot be verified and ask whether to continue establishing the connection. Just answer yes to continue.

After logging in to the server host, you can perform the desired operation. After the work is completed, use the exit command to end the SSH connection with the remote host.

The SSH server is opened on port 22 by default. If the server-side SSH service is not opened on port 22, you can specify the port to connect to through the -p option of SSH.

Example:

ssh -l server -p 202 192.168.43.80 #以202端口连接

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to implement remote login from linux system to linux server. 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