![sshfs: 특정 폴더에 액세스하려고 하면 권한이 거부되었습니다.](https://linux55.com/image/77052/sshfs%3A%20%ED%8A%B9%EC%A0%95%20%ED%8F%B4%EB%8D%94%EC%97%90%20%EC%95%A1%EC%84%B8%EC%8A%A4%ED%95%98%EB%A0%A4%EA%B3%A0%20%ED%95%98%EB%A9%B4%20%EA%B6%8C%ED%95%9C%EC%9D%B4%20%EA%B1%B0%EB%B6%80%EB%90%98%EC%97%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
다음과 같이 특정 폴더에 액세스할 수 있습니다.
ssh -YX [email protected]
cd ../the/folder/I/want
또는 절대 경로를 사용하십시오
ssh -YX [email protected]
cd /the/absolute/path/to/the/folder/I/want
ls
하지만 원격 홈 디렉토리에서는 가져올 수 없습니다.
ssh -YX [email protected]
ls ../the/folder/I/want
-> ls: cannot access ../the/folder/I/want: No such file or directory
sshfs를 사용하여 홈 폴더를 마운트하고 액세스할 수 있습니다. 그러나 sshfs를 사용하여 특정 폴더를 마운트하려고 하면 다음과 같습니다.
sshfs [email protected]:/the/absolute/path/to/the/folder/I/want ~/mountpoint
마운트된 폴더가 보이지만 해당 폴더에 액세스할 수 없습니다. ls -l
로컬 명령의 결과 는 다음과 같습니다 .
d---rwx--- 1 root wheel 4,0K 4 nov 22:46 mountpoint
이 특정 폴더를 마운트하는 방법이 있습니까?
답변1
특정 그룹에게만 접근 권한을 부여하는 폴더가 있을 때 이런 일이 발생합니다. 그러면 sshfs는 그룹의 ID 중 하나가 드라이브를 마운트한 사용자에게 속한 것을 볼 수 없습니다.
다음과 같이 "-o defer_permissions" 옵션을 추가하면 됩니다.
sshfs -o defer_permissions [email protected]:/the/absolute/path/to/the/folder/I/want ~/mountpoint
자세한 내용은 여기에서 확인할 수 있습니다.https://github.com/osxfuse/osxfuse/wiki/Mount-options#default_permissions-and-defer_permissions?
답변2
이는 권한 문제입니다. 관리자가 원격 폴더에 대한 모든 권한을 나에게 부여했을 때 문제가 마침내 해결되었습니다.