1024programmer Linux What is ssh and how does it encrypt information-linux operation and maintenance

What is ssh and how does it encrypt information-linux operation and maintenance

In the early days, the remote connection server used plaintext transmission software, such as telnet and RSH, and later they were all replaced by the ssh protocol. The SSH service can provide information encryption and then transmit the data, which greatly improves the security. SSH has two main functions:

  • Ability to connect to remote hosts and manage host resources

  • Able to transfer files, similar to ftp service

SSH encryption Technology

SSH uses asymmetric encryption technology. Readers who want to know more about symmetric encryption and asymmetric encryption, please Google. Asymmetric encryption is mainly accomplished through the public key and private key. The public key encrypts the information sent, and after receiving the information, the private key is used to decrypt the information.

  • Public key (Public key): The act of encrypting the information sent to the host of the other party, so your host public key Can be given to another host that wants to communicate.

  • Private key (Private key): When the remote host sends the information encrypted with the public key to the current host, the current host uses its own private key to decrypt the information . Remember, your private key must not be known to other hosts.

The following diagrams illustrate how two hosts communicate

First, when host A wants to send information to host B, use The public key of host B encrypts the information to be sent. When host B receives the encrypted information sent by host A, it uses its own private key to decrypt the information. Similarly, when host B sends information to host A, it first encrypts the information with the public key of host A, and then host A, which receives the encrypted information, decrypts it with its own private key.

The process of connecting to a remote host

Let’s look at the local client How to connect to a remote server

  1. When the server starts the sshd service for the first time, it will automatically generate a public key and a private key. These files are stored in the /etc/ssh/ directory.

  2. The local host initiates a request connection to the server through a terminal tool or other methods.

  3. After receiving the client request, the server sends its own public key to the client

  4. If the client did not have Save the public key of the server, then the public key will be saved on the client. For the windows system, the public key is stored in the C:\Users\admin.ssh\known_hosts file, and for the linux host, it is stored in the .ssh/know_hosts file in the home directory.

  5. The client sends its public key to the server, and the server saves the client’s public key.

  6. The client and server communicate.

For more related technical articles, please visit the Linux System Tutorial column!

The above is the detailed content of what is ssh and how it encrypts information. For more information, please pay attention to other related articles on 1024programmer.com!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/what-is-ssh-and-how-does-it-encrypt-information-linux-operation-and-maintenance/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索