在 Windows 8.1 安裝 Cygwin 並設定 SSH 免密碼登入時,ssh-keygen 產生金鑰複製至 authorized_keys 後登入提示:
Permissions 0660 for /home/***/.ssh/id_rsa are too open. It is required that your private key files are NOT accessible by others.
嘗試 chmod 600 卻無法收回 group/other 權限。經排查發現原因在於檔案群組顯示為 None(Cygwin 中無群組)。解決方法:
chgrp Users /home/***/.ssh/id_rsa(指派給普通使用者群組)。chmod 600 /home/***/.ssh/id_rsa 即可生效。此問題源於檔案系統屬性與 Cygwin 模擬 POSIX 權限的差異,補上群組屬性後即可正常限制權限,SSH 免密碼登入即可運作。