Key pair to connect to a Linux server

Source: Internet
Author: User

Preface: This article pure Bo main hand code, belong to the Linux basic thing, idle to ignore wrote an article. qq:1445696451
First, brief
The Linux server provides the SSH (Secure Shell) Remote Connection service, which is one of the tools that our OPS personnel must use. SSH is developed by the IETF Network Group (Working group) and SSH is a security protocol based on the application layer. SSH is currently a more reliable protocol that provides security for Telnet sessions and other network services. The use of SSH protocol can effectively prevent the information leakage in the remote management process. SSH was originally a program on a UNIX system, and later expanded quickly to other operating platforms. SSH can compensate for vulnerabilities in the network when it is used correctly. The SSH client is available on a variety of platforms. Almost all UNIX platforms-including HP-UX, Linux, AIX, Solaris, Digital? UNIX, Irix, and other platforms can run SSH.
SSH is used to include two authentication mechanisms, which are based on the authentication of the user name and password and the use of the key pair authentication. Because of the security needs, the former we are not used in the work.
Second, operation (Xshell part)
The following is a newly installed CentOS7 with the hostname and address as follows

1, Xshell user and password connection
Create a new session, fill in the IP address, choose to use the SSH protocol

User name Root

Confirm after entering password

Then connect and you can see the connection on the

2. Create a key pair using Xshell
Select New key in toolbar

Key type select RSA, the length is arbitrary (the longer the more secure)

Here's the next move.

Enter the key name and then encrypt the key

Click Properties

The public key can be saved to a file

Saved to the desktop

3. Upload the public key to the Linux server and connect it with the key
Click on the icon in the red circle (relative to the use of SFTP 192.168.133.130)

After connecting you will see a popup window that implements the current local working directory as: The working directory for the/session;linux server is/root. (That is, we want to upload and download the operation, the object is the contents of these two directories)

Move the public key file saved to the desktop to: /session under

Upload the public key to the Linux server with the put command

Import public key to root public key file

# #注意: The previous operation explained; View/etc/ssh/sshd_config you can see that the SSH authentication file is in the user's home directory. Ssh/authorized_keys

Edit Session Properties

Set the following

No need to enter the user password in the process to login directly

You can also export the private key

Save private key

Set the private key password

Third, SecureCRT part
1. User Password Verification
Also enter information such as protocol, address, etc.

Accept and save

Enter user name and password

It's connected.

2, the key pair generation part (below, the steps do not repeat)
It's the same here, click Tools-New Key







Upload also use sftp

Login with key after completion

Key pair to connect to a Linux server

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.