Reference https://www.cnblogs.com/ftl1012/p/ssh.html
A, ssh protocol Introduction
SSH (secure shell) is a remote login protocol in a secure manner, is now the preferred way to remotely manage linux system. It provides two security authentication:
1. Password-based authentication - verifying log in with an account and password.
2. Based on the authentication key - key pair needs to be generated locally, and then the public key of the key pair uploaded to the server, is compared with the server's public key.
ssh working mechanism:
Service starts when a key is generated by itself (768bit public key), the local client ssh ssh sends a connection request to the server, the server checks the data sent by the client's connection point and the IP address, transmits a key confirmation (768bits) after legitimate to the client, then the client local private key (256bit) and the server's public key (768bit) binding a key pair key (1024bit), sent back to the server to establish a connection key-pair data transmission.
ssh parameters in linux
Two, ssh practice
1. Create a key pair
Now, generate a hidden .ssh directory in the root directory of the root user, contains two key files. id_rsa the private key, id_rsa.pub is the public key.
2. The public key server installation
3. Edit / etc / ssh / sshd_config file
It can be seen default port number is 22
Open RSA authentication
4. Restart the ssh service
Now download the private key to the client, you can log in via ssh to a linux client program certification.