Window免密連接Linux系統
- 生成公匙
ssh-keygen -t rsa
- 一路回車生成公鑰
- 復制公匙,使用記事本打開復制全部內容
notepad C:\Users\DELL\.ssh\id_rsa.pub
- 內容如"ssh-rsa AAAAB3NzaC1yc2EAAAA…"
- 遠程登錄服務器將內容寫入
~/.ssh/authorized_keys
echo "ssh-rsa AAAAB3NzaC.......OF" >> ~/.ssh/authorized_keys
- 修改權限
chmod 600 ~/.ssh/authorized_keys
、chmod 700 ~/.ssh
- 驗證是否成功
ssh root@xxx.xxx.x.xxx
如果不需要輸入密碼,說明成功了 🎉!