无法在 Windows 7 上使用 Cygwin 设置权限

无法在 Windows 7 上使用 Cygwin 设置权限

我在 64 位 Windows 7 计算机上安装了 Cygwin 1.7.34(0.285/5/3),但我发现无法通过它控制计算机上文件/目录的权限chmod。大多数文件/文件夹的权限似乎都固定在-rw-r--r--

这对我来说是一个问题,因为我的工作站上的目录权限不正确~/.ssh可能是最终导致我与服务器建立无密码 ssh 连接时遇到的一个相关问题

这是我~/.ssh现在的权限:

$ ls -la .ssh/
total 30
drwxr-xr-x 1 davidfallah Domain Users    0 Mar 19 08:21 .
drwxr-xr-x 1 davidfallah Domain Users    0 Mar 18 15:17 ..
-rw-r--r-- 1 davidfallah Domain Users  405 Mar 18 17:26 authorized_keys
-rw-r--r-- 1 davidfallah Domain Users 1675 Mar 18 18:00 gitolite-admin
-rw-r--r-- 1 davidfallah Domain Users  405 Mar 18 18:00 gitolite-admin.pub
-rw-r--r-- 1 davidfallah Domain Users  672 Mar 18 17:27 id_dsa
-rw-r--r-- 1 davidfallah Domain Users  613 Mar 18 17:27 id_dsa.pub
-rw-r--r-- 1 davidfallah Domain Users 1675 Mar 18 17:26 id_rsa
-rw-r--r-- 1 davidfallah Domain Users  405 Mar 18 17:26 id_rsa.pub
-rw-r--r-- 1 davidfallah Domain Users  512 Mar 18 16:16 known_hosts

根据我所研究过的类似问题,我尝试运行chown -v :Users .ssh/*以防万一,并得到以下结果:

$ chown -v :Users .ssh/*
changed ownership of ‘.ssh/authorized_keys’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/gitolite-admin’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/gitolite-admin.pub’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_dsa’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_dsa.pub’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_rsa’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/id_rsa.pub’ from davidfallah:Domain Users to :Users
changed ownership of ‘.ssh/known_hosts’ from davidfallah:Domain Users to :Users

但是,这个确切的输出每次都会重复,表明它实际上没有做出任何更改。同样,尝试运行chmod -v 777 ssh/*(作为权限配置示例)会持续产生以下输出:

$ chmod -v 777 .ssh/*
mode of ‘.ssh/authorized_keys’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/gitolite-admin’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/gitolite-admin.pub’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_dsa’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_dsa.pub’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_rsa’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/id_rsa.pub’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)
mode of ‘.ssh/known_hosts’ changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx)

无论我以普通用户身份还是以管理员身份运行 Cygwin64 终端,此行为都是相同的。

如果相关的话,我的/etc/fstab文件是:

# For a description of the file format, see the Users Guide
# http://cygwin.com/cygwin-ug-net/using.html#mount-table

# This is default anyway:
none /cygdrive cygdrive binary,noacl,posix=0,user 0 0

我还从以下来源获得以下信息df -T

$ df -T
Filesystem     Type 1K-blocks      Used Available Use% Mounted on
C:             ntfs 488282108 184977440 303304668  38% /cygdrive/c
D:             ntfs 488383484   7224840 481158644   2% /cygdrive/d
E:             ntfs 488374972 115013864 373361108  24% /cygdrive/e
U:             ntfs 102403916  94741644    946740 100% /cygdrive/u
W:             ntfs 585869308 187598724 398270584  33% /cygdrive/w
X:             ntfs  29604476  16650464  12954012  57% /cygdrive/x

相关内容