SecureCRT Configure SSH key to access Linux

Source: Internet
Author: User
Tags chmod ssh

The first step is to generate a public/private key pair

Using the SECURECRT tool-> create the public key, the cryptographic algorithm chooses RSA because the RSA algorithm is selected in the sshd configuration file

This step generates two files, the default is identity and Identity.pub, where identity is the key and Identity.pub is the public key. The next pass phrase can not be entered, do not enter the word when landing does not need to enter a pass phrase. If entered, you will be asked to enter a pass phrase when you log in.

The second step is to upload a Windows client SECURECRT generated public key identity.pub to the user directory. SSH folder. Be sure to upload in ASCII format before uploading.

In the user host directory

mkdir. SSH #在需要开启ssh连接的用户目录下建立. SSH directory

chmod 755. SSH

Ssh-keygen-i-F. Ssh/identity.pub>>.ssh/authorized_keys

chmod 644. Ssh/authorized_keys

Third Step

Vim/etc/ssh/sshd_config #修改ssh配置文件

(1) Protocol2 #仅允许使用SSH2

(2) Port22 #使用22端口

(3) Permitrootloginyes #允许root登录

(2) Pubkeyauthenticationyes #启用公告密钥配对认证方式

(3) Authorizedkeysfile.ssh/authorized_keys

(4) Rsaauthenticationyes #允许RSA密钥

(4) Passwordauthenticationno #禁止密码验证登录, if enabled, OpenSSH RSA authentication login is meaningless.

The third step, reload the sshd service, use/etc/init.d/ssh restart can

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

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.