SSH public key without password authentication 1) generate a password on the master host for 1ssh-keygen & amp; ndash; trsa & amp; ndash; P & amp; #39; & amp; #39; press Enter. the command is generated in the user's main directory by default. ssh Directory. you have two key pair files: id_rsa and id_rsa.pub1 [master @ hado... SSH public key without password authentication 1) generate a password for 1ssh-keygen-t rsa-p' on the master host and press Enter. the command is generated in the user's main directory by default. ssh Directory. you have two key pair files: id_rsa and id_rsa.pub 1 [master @ hadoop ~] $ Ll. ssh/2-rw -------. 1 master 1675 Jun 3 id_rsa3-rw-r -- r --. 1 master 402 Jun 3 id_rsa.pub then configure the following on the master node and append id_rsa.pub to the authorized key. 1cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys thought this would be done, and it was found that the command ssh localhost still requires a password. After a long time, I finally found the cause and found the server to modify the SSH configuration file "/etc/ssh/sshd_config". modify the following content (remove the preceding comment) 1 RSAAuthentication yes # enable RSA authentication 2 PubkeyAuthentication yes # enable public key/private key pair authentication method 3 AuthorizedKeysFile. ssh/authorized_keys # after setting the public key file path (the same as the file generated above), remember to restart SSH service 1 service sshd restart to re-verify ssh localhost, the same principle applies when logging on to other machines remotely without a password. you only need to upload the id_rsa.pub generated by the local machine to other servers for the same operation.
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.