Configuration-free key access between Linux

Source: Internet
Author: User

Environment description

[Email protected] ~]# cat/etc/redhat-release CentOS release 6.5 (Final) [[email protected] ~]# Uname-alinux localhost1 2 .6.32-431.el6.x86_64 #1 SMP Fri Nov 03:15:09 UTC x86_64 x86_64 x86_64 gnu/linux

  

Generate secret Key

[Email protected] ~]# ssh-keygen-t rsagenerating public/private RSA key pair. Enter file in which to save the key (/ROOT/.SSH/ID_RSA): Created directory '/root/.ssh '. Enter passphrase (empty for no passphrase): Enter same passphrase Again:your identification have been saved in/root/.ssh/ Id_rsa. Your public key have been saved in/root/.ssh/id_rsa.pub.the key fingerprint is:5e:5a:d4:7f:97:29:39:54:b9:1b:eb:13:12:4c : bc:2b [email protected]the key ' s randomart image is:+--[RSA 2048]----+|. ..|| . O.. | | . +.. .|| . . =.oo| | S o ++o*| | . + E oo=.| | O. O. | | O | | .| +-----------------+

  

Configuring the Secret key Connection

[Email protected] ~]# cat/root/.ssh/id_rsa.pub >>/root/.ssh/authorized_keys[[email protected] ~]# chmod 700/roo t/.ssh/*

  

Copy the local host's public key to the remote host's Authorized_keys file

[Email protected] ~]# ssh-copy-id-i/root/.ssh/id_rsa.pub [email protected]the authenticity of host ' 192.168.8.20 (192.1 68.8.20) ' can ' t be established. RSA Key fingerprint is 63:fe:c9:db:12:66:13:d0:23:e1:33:19:3d:cb:10:72.are your sure you want to continue connecting (yes/n o)? yeswarning:permanently added ' 192.168.8.20 ' (RSA) to the list of known hosts. [email protected] ' s password:

  

Edit an SSH configuration file

[Email protected] ~]# vim/etc/ssh/sshd_config Rsaauthentication yes48 pubkeyauthentication Yes

  

Another machine can do it in reverse to achieve a secret-free access between two

Configure secret-free access between 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.