Automatic Logon Using ssh remote access

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.