Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Cygwin 在 Windows 8.1 設定 SSH 免密碼登入:權限過於開放與群組缺失雙重解決

編輯:Win8 系統應用技巧

在 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 中無群組)。解決方法:

  1. 先賦予群組:chgrp Users /home/***/.ssh/id_rsa(指派給普通使用者群組)。
  2. 再修改權限:chmod 600 /home/***/.ssh/id_rsa 即可生效。

此問題源於檔案系統屬性與 Cygwin 模擬 POSIX 權限的差異,補上群組屬性後即可正常限制權限,SSH 免密碼登入即可運作。

Copyright © Windows教程網 All Rights Reserved