Detailed description of SSH key logon under CentOS6.5

Source: Internet
Author: User

Detailed description of SSH key logon under CentOS6.5
I. Necessity of key Logon

Generally, SSH key logon is safer than Account Password Logon. Sometimes, the company needs to configure Server logon for new colleagues. Generally, SSH key logon is directly configured.

Ii. SSH key logon Step 1. Key Generation

There are usually many ways to generate a key. Here, we use SSH-genkey to generate the key on the positive server, and use puttygen of the client to convert the key.

For example:

-T indicates the encryption method. Then, change the public key name to authorized_keys.

In addition, make sure that the permission for the. ssh directory is 600. If not, use chmod 600. ssh to set the permission. The main purpose is to prevent others from putting the public key under. ssh so that they can log on without a password.

Then, use pscp to load the Private Key to the local machine and use puttygen for conversion.

2. Logon Settings

:

3. After Successful Login

Iii. FAQs. Question 1: server refused our key.

Cause: If you view the log, you can know that the. ssh context is not securely blocked by SELinux.

Solution: restorecon-Rv. ssh. Log On after successful execution.

Problem 2: only the root user can log on, and other users cannot log on.

Cause Analysis: It is generally because. ssh is not set in the corresponding directory

Solution:/root/. ssh/the root account public key is set in this directory. For user A, go to/home/A/. ssh and perform the same settings as root.

For example:

 

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.