SSH password-less login settings

Source: Internet
Author: User

2 machines

1. 192.168.1.112

2. Man-Machine 192.168.1.110

To enable 110, you do not need a password to log on to 112 through SSH.

Procedure

1. Create a key

Miao @ u32-192-168-1-110 :~ /. SSH $ ssh-keygen-T rsagenerating public/private RSA key pair. enter passphrase (empty for no passphrase): (ignore) Enter same passphrase again: (ignore) Your identification has been saved in/home/Miao /. SSH/id_rsa.your public key has been saved in/home/Miao /. SSH/id_rsa.pub.

2. Copy the public key to the server

miao@u32-192-168-1-110:~/.ssh$ scp id_rsa.pub miao@192.168.1.112:/home/miao/.ssh/192.168.1.110miao@192.168.1.112's password: id_rsa.pub                                                                   100%  404     0.4KB/s   00:00    miao@u32-192-168-1-110:~/.ssh$ 

3. Add the public key to the trusted area of 192.168.112.

miao@debian-192-168-1-112:~/.ssh$ cat 192.168.1.110 >> authorized_keysmiao@debian-192-168-1-112:~/.ssh$ 

Note: steps 2 and 3 can be completed by command ssh-copy-ID in one step

miao@ubuntu-192-168-1-110:~/.ssh$ ssh-copy-id miao@192.168.1.112Password:Now try logging into the machine, with "ssh 'miao@192.168.1.112'", and check in:  .ssh/authorized_keysto make sure we haven't added extra keys that you weren't expecting.

4. Start ssh-agent

If SSH 192.168.112 is returned, the agent admitted failure to sign using the key
PS-AF | grep agent: Check whether the ssh-agent is running. If no

miao@u32-192-168-1-110:~/.ssh$ ssh-agent

5. Add id_rsa to the SSH-agent

miao@u32-192-168-1-110:~/.ssh$ ssh-add id_rsa

6. Complete

Author: http://www.jiangmiao.org/blog/559.html

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.