Create an ssh equivalent user on two Centos servers

Source: Internet
Author: User
Create an equivalent user on two linux servers 2) create an equivalent user on node1: [root @ node1 ~] $ Mkdir ~ /. Ssh [root @ node1 ~] $ Chmod700 ~ /. Ssh [root @ node1 ~] $ Ssh-keygen-trsa [root @ node1 ~] $ Ssh-keygen create equivalent users on two linux servers 2) create equivalent users on node1: [root @ node1 ~] $ Mkdir ~ /. Ssh [root @ node1 ~] $ Chmod 700 ~ /. Ssh [root @ node1 ~] $ Ssh-keygen-t rsa [root @ node1 ~] $ Ssh-keygen-t dsa at node2: [root @ node2 ~] $ Mkdir ~ /. Ssh [root @ node2 ~] $ Chmod 700 ~ /. Ssh [root @ node2 ~] $ Ssh-keygen-t rsa [root @ node2 ~] $ Ssh-keygen-t dsa 3) switch back to node1 and run [root @ raw1 ~]. $ Cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys [root @ raw1 ~] $ Cat ~ /. Ssh/id_dsa.pub> ~ /. Ssh/authorized_keys prompt: the following command will prompt you to enter the root password of node2, follow the prompt to enter. if the command fails, try again. Node1 node: [root @ node1 ~] $ Scp ~ /. Ssh/authorized_keys node2 :~ /. Ssh/authorized_keys node2 node: [root @ node2 ~] $ Cat ~ /. Ssh/id_rsa.pub> ~ /. Ssh/authorized_keys [root @ node2 ~] $ Cat ~ /. Ssh/id_dsa.pub> ~ /. Ssh/authorized_keys [root @ node2 ~] $ Scp ~ /. Ssh/authorized_keys node1 :~ /. Ssh/authorized_keys 4) ensure that both nodes have information about each other. The two machines execute each other. [Root @ node1 ~] $ Ssh node1 date [root @ node1 ~] $ Ssh node2 date [root @ node1 ~] $ Ssh node1-priv date [root @ node1 ~] $ Switch the ssh node2-priv date to node2 and execute [root @ node2 ~] $ Ssh node1 date [root @ node2 ~] $ Ssh node2 date [root @ node2 ~] $ Ssh node1-priv date [root @ node2 ~] $ Ssh node2-priv date
Related Article

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.