1

这是我第二次遇到这种情况。

我正在开发一个 Rails 应用程序,我通过 创建一个文件touch show.html.haml,我可以执行ls并查看该文件。

但我同时使用 WinSCP 和 SFTP 进行崇高,但都看不到这个文件!

WinSCP 返回...
在此处输入图像描述

和崇高的回报,
Downloading folder "/app/qa/www/htdocs/qa-dashboard/app/views/scripts/" ... 1 file to download

但它从不下载文件。这里发生了什么?我还验证了这不是touch命令。我试过vi'ing文件,并保存它。一样。

我还验证了主机是否匹配。

补充说明:

我正在使用elevated_user创建文件和用户ddavison来编辑文件。 ddavison不在组内。

文件模式是,

drwxrw-rw- ... .
drwxr-xrwx ... ..
-rw-rw-rw- ... show.html.haml
4

3 回答 3

2

The permissions on your scripts directory appear to be incorrect:

drwxrw-rw- ... .
      ^--^-- missing eXecute bit

The execute bit on directories allows the directory's contents to be listed. Since the "group" and "other" perms on the scripts directory do not allow listing, you'll get that error. Most like you're logged in to the shell as the owner of the directory, so you can get listings all you want, but you're logging in as a user OTHER than the owner via winscp, so they're unable to list the directory contents.

于 2013-08-20T17:26:38.343 回答
2

我希望问题出在包含目录的权限上 -

drwxrw-rw- ... .

这两个程序都可能在检索文件之前尝试 chdir 进入该目录。为此,目录必须对其登录的用户具有 x(执行)权限。根据您所说,似乎 set 'other' 需要 +x -

chmod o+x /app/qa/www/htdocs/qa-dashboard/app/views/scripts/

根据有问题的用户/组,您可能需要考虑删除写权限 -

chmod o-w /app/qa/www/htdocs/qa-dashboard/app/views/scripts/
于 2013-08-20T17:30:38.940 回答
1

For directories, the x permission bit isn't execute, rather it's "list the contents of this directory". Since the directory's permissions are only 'rwxrw-rw-', only the owner may list the contents of the directory. Provide "other" that permission using chmod o+x /app/qa/www/htdocs/qa-dashboard/app/views/scripts.

于 2013-08-20T17:26:33.017 回答