Install Hadoop series-Install SSH password-free login

Source: Internet
Author: User
Tags scp command ssh server

Configure SSH password-free login 1) Verify that the ssh:ssh-version is installed
The following shows the successful installation of the
Openssh_6.2p2 ubuntu-6ubuntu0.1, OpenSSL 1.0.1e 2013
Bad escape character ' rsion '.
Otherwise installation Ssh:sudo Apt-get install SSH
2) ssh-keygen-t dsa-p "-F ~/.SSH/ID_DSA
Explain that the Ssh-keygen represents the generated key;-t (note case sensitive) represents the specified generated key type; DSA is the meaning of DSA key authentication, that is, the key type;-P is used to provide a passphrase;-f Specifies the generated key file. (about the key words of the knowledge is not described in detail here, it will involve some of the knowledge of SSH, if the reader is interested, you can check the information yourself. )

. SSH indicates that the ssh file is hidden.
In Ubuntu, ~ represents the current user folder, which is/home/u.
This command creates two files under the. ssh folder Id_dsa and Id_dsa.pub, which is a pair of SSH private keys and public keys, similar to keys and locks, to append the id_dsa.pub (public key) to the authorized key.
Enter the command:
3) Cat ~/.ssh/id_dsa.pub >> ~/.ssh/authorized_keys
This passage means that the public key is added to the public key file for authentication, where the Authorized_keys is the public key file for authentication. At this point no password login This machine has been set up. 4) You can now log in to SSH to confirm that you do not need to enter a password:~$ ssh localhost logout:
~$ exit the second time login:
~$ ssh localhost
Log out:
~$ exit
This way, you don't have to enter a password to log in. 5) SCP < local file name > < user name >@<ssh server address >:< upload save path is filename >With SSH, we cannot use simple drag-and-drop or copy-and-paste operations to communicate with files on the local computer and the SSH server. We need to use the SCP command line.
Example to illustrate. If you want to upload the A.txt file in the current directory to the test folder on the SSH server and rename it to B.txt, where the SSH server URL is 127.0.0.1, username admin. The code is as follows:
Program code
SCP a.txt [Email protected]:./test/b.txt
Downloading is also very simple, just need to swap the "local file name" and the information behind the server. SCP hadoop-1.0.3.tar.gz [Email protected]:~/

Install Hadoop series-Install SSH password-free login

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.