步驟如下:
ssh-keygen -t rsa 或 ssh-keygen -d (dsa) => 產生出 id_rsa, id_rsa.pub
scp id_rsa.pub server_hostname:~/.ssh/
ssh server_hostname
cat .ssh/id_rsa.pub >> .ssh/authorized_keys
cat .ssh/id_rsa.pub >> .ssh/authorized_keys2
同時COpy到對方節點。
即可
這樣子就可以key認證登入,不需輸入密碼。