Remote login via SSH in Ubuntu requires no password

Source: Internet
Author: User

First, prepare two Linux OS hosts. The VM is used here.

First:

[Email protected]: ~ $ Hostname
Chiwei-virtualbox

IP: 192.168.8.144

Second:

[Email protected]: ~ /. Ssh $ hostname
Chiwei-hadoop

IP: 192.168.8.200


Install the OpenSSH-server http://blog.csdn.net/simonchi/article/details/38871953 on both machines separately.


After the installation is complete, you can use the SSH command.

Run ssh-keygen-t rsa on the first Server

[Email protected]: ~ $ Ssh-keygen-T RSA
Generating public/private RSA key pair.
Enter file in which to save the key (/home/chiwei/. Ssh/id_rsa ):
Enter passphrase (empty for no passphrase ):
Enter same passphrase again:
Your identification has been saved in/home/chiwei/. Ssh/id_rsa.
Your public key has been saved in/home/chiwei/. Ssh/id_rsa.pub.
The key fingerprint is:
1D: 45: B5: A3: 54: 6e: A7: F6: 65: 79: 27: 9B: A6: 1c: D4: D2 [email protected]
The key's randomart image is:
+ -- [RSA 2048] ---- +
|. O. o |
|. O. |
|... =. |
|. O = +. |
| S. + E. = |
|. O * + |
|. +. |
|. + |
| O |
+ ----------------- +

Run CP id_rsa.pub authorized_keys

Run

[Email protected]: ~ /. Ssh $ SCP authorized_keys [email protected]:/home/chiwei/. SSH
[Email protected]'s password:
Authorized_keys 100% 406 0.4kb/s
[Email protected]: ~ /. Ssh $ SSH chiwei-hadoop
Welcome to Ubuntu 14.04 lts (GNU/Linux 3.small-24-generic x86_64)


* Documentation: https://help.ubuntu.com/


359 packages can be updated.
6 updates are security updates.

Go to the second server to view

[Email protected]: ~ /. Ssh $ ls
Authorized_keys id_rsa id_rsa.pub
[Email protected]: ~ /. Ssh $

The file has been uploaded.

Now you can log on to the first host directly using ssh on the second host.



Remote login via SSH in Ubuntu requires no password

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.