SSH金鑰製作和傳送

產生金鑰

$ ssh-keygen -t rsa

複製金鑰至別台機器

$ ssh-copy-id -i ~/.ssh/id_rsa.pub USER@B_ip

金鑰文件相關權限

chmod 700 /root/.ssh/id_rsa.pub
chmod 644 /root/.ssh/authorized_keys
chmod 755 /home/xxx/

想要免密碼登入別台機器 要將本機的金鑰(id_rsa.pub) 寫進
別台機器的authorized_keys
金鑰可帳號對帳號 不是機器對機器
可以A帳號對B帳號