SSH password-free remote login (1)

Source: Internet
Author: User

------------------------------------------------ For Super Users, ssh password-free logon ------------------------------------

Environment Introduction:

HOST 1: IP 192.168.200.142

Host 2: IP 192.168.200.158

User Requirements: Password-free logon is required for both the host and the host.

Command: ssh scp, installation package: OpenSSH-clients

Password-free process:

1,Ssh-keygen-t rsa (Operation on Host 1)

[[Email protected] ~] # Ssh-keygen-T RSA
Generating 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 has been saved in/root/. Ssh/id_rsa.
Your public key has been saved in/root/. Ssh/id_rsa.pub.
The key fingerprint is:
70: 58: 3f: 09: 6d: BB: 2C: Ea: F9: 78: 2b: 05: 7A: 92: 1D: 3D [email protected]
The key's randomart image is:
+ -- [RSA 2048] ---- +
| O. |
| O oo. |
| O... +. |
| OOE... |
| + Oso. |
| + O |
| O. |
| Oo. |
|. ++ O. |
+ ----------------- +

2. Ssh-copy-ID-I ~ /. Ssh/id_rsa.pub 192.168.200.158(Operation on Host 1)

[[Email protected] ~] # Ssh-copy-ID-I ~ /. Ssh/id_rsa.pub 192.168.200.158
The authenticity of host' 192. 168.200.158 (192.168.200.158) 'can't be established.
RSA key fingerprint is F0: 4C: 31: B9: A6: 3C: BC: D8: 9B: 05: 77: 62: 22: 9B: 7e: 0a.
Are you sure you want to continue connecting (Yes/No )? Yes
Warning: Permanently added '192. 168.200.158 '(RSA) to the list of known hosts.
[Email protected]'s password:
Now try logging into the machine, with "ssh '192. 168.200.158 '", and check in:

. Ssh/authorized_keys

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

 

3. Ssh 192.168.200.158(Operation on Host 1)

SSH 192.168.200.158
Last login: Sat Oct 27 05:34:11 2018 from 192.168.200.1

 

Pay special attention to permission issues:

-------------------------------------- HOST 1 -------------------------------------------------------

 

---------------------------------- Host 2 -------------------------------------------------------------------------

 

SSH password-free remote login (1)

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.