1. 設(shè)置無(wú)需密碼的ssh登陸,方法如下:
假設(shè)A,B兩服務(wù)器,現(xiàn)在需要在A機(jī)上用root登陸B(tài)機(jī),而不需要輸入密碼,那我們可按照下面的步驟來(lái)做:
1)在A機(jī)上生成鑰匙對(duì),執(zhí)行以下命令:
ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): /root/.ssh/id_rsa
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:
f6:61:a8:27:35:cf:4c:6d:13:22:70:cf:4c:c8:a0:23 root@host1