![사용자가 디렉터리를 탐색할 수 있도록 허용하지만 다른 파일/디렉터리의 존재를 확인하지 못하게 하는 방법](https://linux55.com/image/92115/%EC%82%AC%EC%9A%A9%EC%9E%90%EA%B0%80%20%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EB%A5%BC%20%ED%83%90%EC%83%89%ED%95%A0%20%EC%88%98%20%EC%9E%88%EB%8F%84%EB%A1%9D%20%ED%97%88%EC%9A%A9%ED%95%98%EC%A7%80%EB%A7%8C%20%EB%8B%A4%EB%A5%B8%20%ED%8C%8C%EC%9D%BC%2F%EB%94%94%EB%A0%89%ED%84%B0%EB%A6%AC%EC%9D%98%20%EC%A1%B4%EC%9E%AC%EB%A5%BC%20%ED%99%95%EC%9D%B8%ED%95%98%EC%A7%80%20%EB%AA%BB%ED%95%98%EA%B2%8C%20%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
사용자가 디렉토리를 탐색할 수 있지만 디렉토리에 어떤 것도 존재한다는 것을 증명할 수 없는 디렉토리를 설정하려고 합니다. 사용자에게 실행 권한은 있지만 읽기 권한은 없도록 권한 설정을 시도했습니다. 불행하게도 반환된 오류("해당 파일이나 디렉터리가 없습니다." 또는 "권한이 거부되었습니다.")는 해당 항목이 디렉터리에 존재하는지 확인합니다.
예를 들어, 지금까지 본 내용은 다음과 같습니다.
$ sudo ls -l permTest/
total 4
drwxr-x--- 2 root root 4096 Aug 10 12:35 exists
$ ls -ld permTest
drwxr-x--x 3 root root 4096 Aug 10 12:35 permTest/
$ ls permTest
ls: cannot open directory 'permTest': Permission denied
$ ls permTest/doesnotexist
ls: cannot access 'permTest/doesnotexist': No such file or directory
$ ls permTest/exists
ls: cannot open directory 'permTest/exists': Permission denied
마지막 줄의 오류 메시지가 동일해지기를 바랍니다.
관련이 있는 경우 MapRFS에서 설정하려고 합니다. 이는 광범위하게 POSIX와 호환됩니다.
답변을 읽었습니다.절대 경로명으로만 접근할 수 있는 보이지 않는 디렉토리를 만드는 방법은 무엇입니까?, 그러나 내 문제에 대한 해결책을 찾지 못했습니다.
답변1
사용자가 파일을 나열할 수 있으면 파일의 존재를 숨길 수 없습니다.
$ ls -l permTest/insidedir/doesexist
-rw-r--r-- 1 root root 0 Aug 10 01:55 permTest/insidedir/doesexist
두 디렉터리(permTest 및 insidedir)는 루트가 소유하고 다음 x
권한만 가집니다.
$ sudo ls -la permTest/insidedir/
total 8
d--x--x--x 2 root root 4096 Aug 10 01:55 .
d--x--x--x 3 root root 4096 Aug 10 01:54 ..
-rw-r--r-- 1 root root 0 Aug 10 01:55 doesexist
$ ls -la permTest/
ls: cannot open directory permTest/: Permission denied
$ ls -la permTest/insidedir/
ls: cannot open directory permTest/insidedir/: Permission denied