SSH Key Password-free authentication

Source: Internet
Author: User

For Mac OS install Ssh-copy-id:

Brew Install Ssh-copy-id


For Linux Install Ssh-copy-id

Yum Install openssh*


STEP:


1: Generate SSH Public key

[Email protected] ~]# ssh-keygen-t DSA

Generating Public/private DSA key pair.

Enter file in which to save the key (/ROOT/.SSH/ID_DSA):

Enter passphrase (empty for no passphrase):

Enter same Passphrase again:

Your identification has been saved IN/ROOT/.SSH/ID_DSA.

Your public key has been saved in/root/.ssh/id_dsa.pub.

The key fingerprint is:

6e:20:94:d5:e1:cc:42:9f:37:de:ce:bb:d9:e4:f6:6d [email protected]


A hidden directory is generated in the current home directory. SSH and DSA files

[email protected]. ssh]# Ls-la

Total 24

drwx------2 root root 4096 Jul 8 06:17.

Drwxr-x---4 root root 4096 Jul 8 06:10.

-RW-------1 root root 622 Jul 8 06:10 Authorized_keys

-RW-------1 root root 668 Jul 8 06:17 ID_DSA

-rw-r--r--1 root root 605 Jul 8 06:17 id_dsa.pub


2:copy public key to a server that requires password-free login

[email protected]. ssh]# ssh-copy-id-i id_dsa.pub [email protected]

10

The authenticity of host ' 172.16.1.11 (172.16.1.11) ' can ' t be established.

RSA key fingerprint is 31:e6:9a:7a:02:a4:60:eb:b8:44:d0:30:80:1c:76:7d.

Is you sure want to continue connecting (yes/no)? Yes

warning:permanently added ' 172.16.1.11 ' (RSA) to the list of known hosts.

[email protected] ' s password:

Now try logging to the machine, with "ssh" [email protected] ' ", and check in:


. Ssh/authorized_keys


To make sure we haven ' t added extra keys so you weren ' t expecting.


3: Implement password-free login

[email protected]. ssh]# ssh [email protected]

Last Login:fri Jul 8 02:00:40 from 172.16.1.1

[Email protected] ~]#


SSH Key Password-free authentication

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.