Today I will share with you the knowledge related to the SSH protocol, I hope it will be helpful to everyone! 1. Introduction to SSH protocol conceptsSSH (Secure Shell) is a security protocol built on the application layer. It can provide a secure transmission environment for network services in an insecure network by encrypting and transmitting passwords for verification, and realize the connection between the SSH client and the SSH server. Therefore, SSH is based on the client-server model. 2. SSH service compositionThe SSH service consists of the server software OpenSSH and the connection client (SSH, SecureCRT, xshell, etc.), and the default port is 22. SSH is a daemon process that is responsible for real-time monitoring of client requests and processing them. 3. SSH protocol framework compositionThe three core protocols in the SSH protocol framework are: transport layer protocol, user authentication protocol, and connection protocol.
4. SSH workflow4.1 Version number negotiation phaseSSH currently includes two versions: SSH1 and SSH2. Both parties determine the version to be used through version negotiation.
Note: Messages in the version number negotiation phase are all transmitted in plain text. 4.2 Key and algorithm negotiation phaseSSH supports multiple encryption algorithms. Both parties negotiate the final algorithm to be used based on the algorithms supported by the server and the client.
Note: Before the negotiation phase, the server has generated an RSA or DSA key pair, which is mainly used to participate in the generation of session keys. 4.3 Authentication PhaseThe SSH client sends an authentication request to the server, and the server authenticates the client
4.4 Session request phase:After authentication, the client sends a session request to the server
4.5 Interactive Conversation PhaseAfter the session request is passed, the server and client can exchange information
Note: At this stage, data can be transmitted bidirectionally. 5. SSH authentication method5.1 Password authentication:The client sends a password authentication request to the server, and then encrypts the username and password and sends it to the server; the server decrypts the information to obtain the plain text of the username and password, compares it with the username and password saved on its own device, and returns a message indicating whether the authentication is successful or failed. 5.2 publickey authentication:The client is authenticated by digital signature. Currently, two public key algorithms, RSA and DSA, can be used on the device to implement digital signature. The client sends a publickey authentication request containing the user name, public key, and public key algorithm to the server. The server checks the legitimacy of the public key. If it is not legal, a failure message is sent directly; otherwise, the server authenticates the client with a digital signature and returns a message of success or failure of authentication. 5.3. Password-publickey authentication (SSH2.0)Specifies that the authentication method for this user must be both password and publickey authentication. Note: Users whose client version is SSH1 can log in by passing either authentication method; users whose client version is SSH2 must pass both authentication methods to log in. 5.4 any authentication (SSH2.0)Specifies that the authentication method for this user can be either password or publickey. 6. Common SSH commands6.1 Remote Loginssh username@remote host ip: The first login requires downloading the other party's public key. Example: ssh 192.168.1.100 6.2 Remote Uploadscp [local location of the file to be uploaded] root@remote host ip:[path to be saved on the remote host]: upload files from the local to the remote host Example: scp /root/test.sh [email protected] 6.3 Remote Replicationscp root@remote host ip:[absolute path of remote host file] [local location to be saved]: Download files from the remote host to the local machine. Example: scp [email protected]:/root/test.sh /root |
<<: Don’t listen to the merchants’ lies: WiFi signals can’t actually penetrate walls
>>: 6G research should be prepared for a rainy day
[[411113]] According to the latest report "C...
Edge and 5G have become leading areas of investme...
The global COVID-19 pandemic has accelerated the ...
On December 4, 2013, the Ministry of Industry and...
BandwagonHost has launched a special package call...
Germany is even more reliant on Huawei for its 5G...
On May 15 , IBM launched a set of tools called &q...
[[350048]] This article is reprinted from the WeC...
On December 7, the GNTC Global Network Technology...
[[405743]] We often use the localhost domain name...
Hello everyone, I am Xiaolin. A reader was asked ...
The State Administration for Market Regulation ha...
When an enterprise develops to a certain extent, ...
The continuous emergence and upgrading of online ...
South Korea's Ministry of ICT recently said t...