Automatic logon through ssh remote access: linux Server Management usually requires frequent switching. You must enter the account and password of the accessed server for each switch. It is also inconvenient for administrators. Ssh is fully called the secure shell, which is translated into secure shell protocol. It is mainly used to provide secure remote login sessions between servers. This protocol is based on the application layer and transmission layer. There are two authentication methods for ssh: one is login through username and password authentication, the most common method, but there is a risk of brute force cracking. One is to pass key authentication, which is more secure. During the entire communication process, to achieve secure SSH connections, the server and client have to go through the following five phases: 1. Version Number negotiation phase. SSH currently includes SSH1 and SSH2 versions, both parties determine the version 2 used through version negotiation. In the key and algorithm negotiation phase, SSH supports multiple encryption algorithms. Both parties follow the algorithms supported by both the local and peer end, negotiate the final algorithm used. 3. In the authentication phase, the SSH client initiates an authentication request to the server, and the server authenticates the client. 4. The session request phase. After the authentication is passed, the client sends a session request to the server. 5. In the interactive session stage, after the session request passes, the server and the client perform information interaction operations: 1. ssh public key and key information exist in/root /. ssh/directory. This directory stores four types of files. public Key 2. private Key 3. known access account records 4. the authenticated public key. -rw-r --. 1 root 405 June 12 04:56 authorized_keys-rw -------. 1 root 1675 June 12 04:49 id_rsa-rw-r -- r --. 1 root 405 June 12 04:49 id_rsa.pub-rw-r -- r --. 1 root 391 June 12 04:54 known_hosts www.2cto.com 2. The first choice is to use the command [ssh-keygen] to generate the Public Key (id_rsa.pub) and key (id_rsa) files. 3. Copy the Public Key (id_rsa.pub) of the server you want to access to the/root/. ssh/directory of the Local Machine and change it to authorized_keys. NOTE: If there are multiple public keys on the accessed server, you only need to add information in the last line of the file authorized_keys. For example, cat ***> authorized_keys 4. Modify the ssh configuration file (/etc/ssh/sshd_config) and set public key authentication. log on and remove the comments in the following two lines, restart the ssh service RSAAuthentication yesAuthorizedKeysFile. ssh/authorized_keys 5, OK, please try again, ssh *. *. *. * (IP address ). Try the dig scp command again. Does it not require user authentication. NOTE: Refer to http://itercast.com it blog video
Author: HYHOLINE