SSH to RHEL7 using Xshell via public key

Source: Internet
Author: User

first Open Xshell, "Tools"-->> "New user key Generation Wizard"650 this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/8D/14/ Wkiol1ifwcoqi9fwaaa5vyqrfai530.jpg-wh_500x0-wm_3-wmp_4-s_61704124.jpg "style=" Float:none; "title=" 1 "alt=" Wkiol1ifwcoqi9fwaaa5vyqrfai530.jpg-wh_50 "/>

Select key Type "RSA", key length,

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8D/17/wKiom1iFwcTAzqalAACLXSYe8kg984.jpg-wh_500x0-wm_3 -wmp_4-s_1507375483.jpg "style=" Float:none; "title=" 2 "alt=" Wkiom1ifwctazqalaaclxsye8kg984.jpg-wh_50 "/>

Enter the name of the key, set the key encryption password (can make the key more secure)

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/8D/14/wKioL1iFwcTDdpRWAAB3d7veNsM908.jpg-wh_500x0-wm_3 -wmp_4-s_2945121311.jpg "style=" Float:none; "title=" 3 "alt=" Wkiol1ifwctddprwaab3d7vensm908.jpg-wh_50 "/>

The format of the key "OpenSSH", saved to the local host

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8D/14/wKioL1iFwcWDzFKWAACnG3PEdso713.jpg-wh_500x0-wm_3 -wmp_4-s_1964176774.jpg "style=" Float:none; "title=" 4 "alt=" Wkiol1ifwcwdzfkwaacng3pedso713.jpg-wh_50 "/>

Connect to the Linux client, go to the home directory of the user to log in to the remote key, enter the ~/.SSH directory (if no one can be created, its permission is 700), use the RZ command to upload the password file on the local host to the ~/.SSH directory of the Linux client, The modified file name is Authorized_keys, and its permissions are

Next, set the configuration file/etc/ssh/sshd_config for the sshd service,

Rsaauthentication Yes

Pubkeyauthentication Yes

Usepam Yes

Challengeresponseauthentication No

Test Xshell

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/8D/17/wKiom1iFxP3hbuzKAAAz9VAoj5U636.jpg-wh_500x0-wm_3 -wmp_4-s_828555694.jpg "title=" 5.jpg "alt=" Wkiom1ifxp3hbuzkaaaz9vaoj5u636.jpg-wh_50 "/>

Determine the user name to log in, select public key mode login, select the user key, enter the key encryption password;

The test can log in normally can be in the configuration file/etc/ssh/sshd_config, prohibit password login

Passwordauthentication no//No key login is not a big point.

If you want to disable log on as root user,

Permitrootlogin No


These are the learning experience, deficiencies, please correct me!



SSH to RHEL7 using Xshell via public key

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.