NFSv4.1 프로토콜을 사용하면 Kerberos를 사용하여 Filestore 인스턴스에 대한 액세스를 보호할 수 있습니다. 자세한 내용은 지원되는 프로토콜 정보를 참고하세요.
또는 Linux 옵션을 사용하여 NFS 액세스를 제어하고 Identity and Access Management (IAM)를 사용하여 인스턴스 생성, 수정, 보기, 삭제와 같은 인스턴스 작업에 대한 액세스를 제어할 수 있습니다. 다음 가이드에서는 이러한 각 작업을 완료하는 방법을 안내합니다.
Fileshare 내보내기 설정
Filestore 파일 공유에는 다음과 같은 기본 /etc/exports 설정이 할당됩니다.
파일 공유 연결이 허용된 클라이언트를 식별하는 클라이언트 목록에는 Filestore 인스턴스에 대해 선택한 VPC 네트워크의 모든 내부 IP 주소가 포함됩니다. 내부 IP 주소는 서브넷 범위에 나열된 모든 범위일 수 있습니다. 하지만 클라이언트가 RFC 1918 이외의 서브넷 범위에 있으면 IP 기반 액세스 제어를 사용하여 Filestore 인스턴스에 대한 액세스 권한을 명시적으로 부여해야 합니다.
파일 공유에서 읽기 및 쓰기 작업을 모두 허용하도록 rw 옵션이 사용됩니다.
사용자 ID 매핑 옵션 no_root_squash가 사용되므로, 루트 사용자를 포함한 모든 사용자 및 그룹은 Filestore 인스턴스 및 클라이언트에서 모두 동일해야 합니다.
기본 SSD 및 기본 HDD 인스턴스는 /config/google-prober 라벨이 지정된 내보낸 공유를 만들어 액세스, 내구성, 성능을 확인하는 내부 프로브 프로세스를 지원하는 데 사용합니다. 이전 섹션에 명시된 설정과 동일한 설정을 사용하여 인스턴스 IP 주소에만 액세스할 수 있는 클라이언트 목록으로 공유를 내보냅니다. 공유는 인스턴스에서 호스팅되거나 인스턴스에서 생성된 프로버에 액세스할 수 있으며 인스턴스 외부에서 액세스할 수 없습니다. 인스턴스는 IP 기반 액세스 제어가 적용되는지와 관계없이 공유를 내보냅니다. 사용자는 showmount -e 명령어를 사용하여 내보낸 공유를 볼 수 있습니다.
IP 기반 액세스 제어
Google Cloud 콘솔을 사용하여 액세스 제어 규칙을 만들거나 gcloud CLI를 사용하여 인스턴스를 만드는 동안 JSON 구성 파일을 지정하여 내보내기 설정을 변경할 수 있습니다. 자세한 내용은 IP 기반 액세스 제어 구성을 참조하세요.
인스턴스가 생성된 후에 새 액세스 제어 규칙을 추가하거나 기존 규칙을 수정할 수도 있습니다. 자세한 내용은 인스턴스 수정을 참조하세요.
파일 공유 권한
Filestore 인스턴스를 만들 때 해당 인스턴스의 파일 공유에는 기본 POSIX 파일 권한인 rwxr-xr-x가 포함됩니다. 이러한 권한은 Filestore 인스턴스에서 연결된 클라이언트의 루트 사용자만 파일 공유에 대해 읽기 및 쓰기 권한을 가짐을 의미합니다. 다른 사용자는 기본적으로 읽기 액세스 권한만 가집니다. 클라이언트 루트 사용자는 권한 및 소유자를 변경할 수 있습니다.
파일 공유의 액세스 구성
파일 공유를 마운트할 때 마운트 옵션과 /etc/fstab 설정을 사용하여 파일 공유의 쓰기 가능 여부와 여기서 파일을 실행할 수 있는지 여부를 결정할 수 있습니다. 파일 공유를 마운트한 후에는 chmod 및 setfacl과 같은 표준 Linux 명령어를 사용하여 파일 및 파일 공유 권한을 설정할 수 있습니다. 기본 등급만 setfacl을 지원합니다.
일관적 권한 설정
권한 에스컬레이션을 방지하려면 동일한 Filestore 인스턴스에 연결되는 모든 클라이언트에서 각 사용자에게 일관된 권한을 설정하는 것이 좋습니다. 파일 공유가 두 개 이상의 클라이언트에 마운트되었고 사용자에게 한 클라이언트에 대한 루트 권한만 있지만 다른 클라이언트에 대해서는 루트 권한이 없는 경우, 다음과 같은 권한 에스컬레이션 시나리오가 가능합니다.
사용자는 루트 액세스 권한이 있는 클라이언트의 실행 파일에 setuid 속성을 설정합니다.
그런 다음 사용자는 실행 파일을 파일 공유에 업로드합니다.
사용자는 업로드된 파일을 최소한 읽기 권한을 가진 모든 클라이언트에서 루트로 실행합니다.
이 시나리오는 setuid 비트를 통해 사용자가 파일 소유자 권한(이 경우에는 루트)을 사용하여 파일을 실행할 수 있기 때문에 가능합니다.
중복되는 권한
이제 영역, 리전, 엔터프라이즈 인스턴스에서 겹치는 권한을 지원합니다.
겹치는 IP 주소 서브넷에 대해 두 개의 개별 액세스 제어 규칙이 정의된 경우 더 작은 서브넷에 정의된 규칙이 우선 적용됩니다.
예를 들어 JSON 구성 파일에 IPv4 주소 서브넷 10.0.0.0/24에 대한 읽기 및 쓰기 액세스 권한을 부여하는 규칙이 포함되어 있고 별도의 규칙으로 IPv4 주소 서브넷 10.0.0.0/28에 대한 읽기 전용 액세스 권한을 부여하는 경우 Filestore는 먼저 더 작은 서브넷에 대한 규칙을 인식하고 적용합니다. 그런 다음 다른 규칙이 정의된 IP 주소 서브넷의 나머지 부분에 적용됩니다. 이 예시에서 IPv4 주소 10.0.0.20를 사용하는 클라이언트에는 읽기 및 쓰기 권한이 부여되고 10.0.0.12를 사용하는 클라이언트에는 읽기 전용 권한이 부여됩니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eFilestore instance access can be controlled using Kerberos with the NFSv4.1 protocol or through Linux options and Identity and Access Management (IAM) for instance operations.\u003c/p\u003e\n"],["\u003cp\u003eBy default, Filestore file shares allow connections from any internal IP address within the selected VPC network, offering read and write access with \u003ccode\u003eno_root_squash\u003c/code\u003e user ID mapping.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize export settings and create access control rules for Filestore instances via the Google Cloud console or gcloud CLI, including the ability to add or modify these rules after instance creation.\u003c/p\u003e\n"],["\u003cp\u003eFilestore instances have default POSIX file permissions of \u003ccode\u003erwxr-xr-x\u003c/code\u003e, with only root users on connected clients initially having read and write access, and all other users only having read.\u003c/p\u003e\n"],["\u003cp\u003eZonal, regional, and enterprise Filestore instances support overlapping permissions for different IP address subnets, where rules for smaller subnets take precedence over larger ones, but identical IPv4 subnets are not supported and basic tiers do not support overlapping permissions.\u003c/p\u003e\n"]]],[],null,["# Access control\n\nThis page describes how to control access to Filestore instances.\n\n- With the [NFSv4.1 protocol](/filestore/docs/configure-nfsv4), you can use\n Kerberos for securing access to Filestore instances. For more\n information, see [About supported protocols](/filestore/docs/about-supported-protocols).\n\n- Alternatively, you can use the Linux options to control NFS access and\n [Identity and Access Management (IAM)](/filestore/docs/iam) to control access to instance\n operations, such as creating, editing, viewing, and deleting instances. The\n following guide walks you through how to complete each of these tasks.\n\nFile share export settings\n--------------------------\n\nA Filestore file share is assigned the following default\n[`/etc/exports`](https://linux.die.net/man/5/exports)\nsettings:\n\n- The client list---which identifies the clients allowed to connect to the file share---contains every internal IP address in the VPC network you selected for the Filestore instance. Internal IP addresses can be any range listed in [subnet\n ranges](/vpc/docs/subnets#manually_created_subnet_ip_ranges). However, if you have clients on non-[RFC 1918](https://tools.ietf.org/html/rfc1918) subnet ranges, you must explicitly grant them access to the Filestore instance using [IP-based access control](/filestore/docs/creating-instances#configure_ip-based_access_control).\n- The `rw` option is used, so the file share allows both read and write operations.\n- The user ID mapping option `no_root_squash` is used, so all users and groups, including the root user, are expected to be the same on both the Filestore instance and the client.\n- All other options use the [`/etc/exports`](https://linux.die.net/man/5/exports) defaults.\n\n### Basic-tier instances\n\nBasic SSD and basic HDD instances create an exported share labeled\n`/config/google-prober`, used to help support internal probing processes, which\nin turn verify access, durability, or performance. The share is exported to a\nclient list made accessible to the instance IP address only, using the same\nsettings as indicated in the previous section. The share is accessible to probers\nhosted on or originating from the instance only and is inaccessible outside of\nthe instance. The instance exports the share regardless of whether\n[IP-based access control](/filestore/docs/creating-instances#configure_ip-based_access_control)\nis applied. Users can see the exported share using the `showmount -e` command.\n\n### IP-based access control\n\nYou can change these export settings by creating access control rules using\nthe Google Cloud console or by specifying a JSON configuration file during\ninstance creation using the gcloud CLI. For details, see\n[Configuring IP-based access control](/filestore/docs/creating-instances#configure_ip-based_access_control).\n\nYou can also add new access control rules or modify existing ones after an\ninstance is created. For details, see [Editing instances](/filestore/docs/editing-instances).\n\nFile share permissions\n----------------------\n\nWhen you create a Filestore instance, the file share for that\ninstance has default POSIX file permissions of `rwxr-xr-x`. These permissions\nmean that on a Filestore instance, only root users on connected\nclients have read and write access to the file share. Other users have only read\naccess by default. Client root users can change permissions and owners.\n\n### Configuring access on a file share\n\nWhen mounting a file share, you can use\n[mount options](https://linux.die.net/man/8/mount) and\n[`/etc/fstab`](https://linux.die.net/man/5/fstab) settings to determine whether the\nfile share is writable and if files can be executed on it. After mounting the file share,\nyou can use standard Linux commands like [`chmod`](https://linux.die.net/man/1/chmod),\nand [`setfacl`](https://linux.die.net/man/1/setfacl)\nto set file and file share permissions. Only basic tiers support `setfacl`.\n\n### Setting consistent permissions\n\nWe strongly recommend that you set consistent permissions for each user on all\nclients that connect to the same Filestore instance to prevent\nprivilege escalation. If a file share is mounted on more than one client\nand a user has root privileges on one client but not the others, then the\nfollowing privilege escalation scenario is possible:\n\n- A user sets the `setuid` attribute on an executable file from the client where the user has root access.\n- The user then uploads the executable file to the file share.\n- The user executes the uploaded file as root on any client where the user has at least read permission.\n\nThis scenario is possible because the `setuid` bit allows the user to execute a\nfile using the permissions of the file owner, which in this case is root.\n\n### Overlapping permissions\n\nZonal, regional, and enterprise\ninstances now support overlapping permissions.\n\nIf two separate access control rules are defined for overlapping IP address\nsubnets, the rule defined for the smaller subnet takes priority.\n\nFor example, if a JSON configuration file contains a rule granting read and\nwrite access for the IPv4 address subnet `10.0.0.0/24`, and a separate rule\ngrants read-only access for the IPv4 address subnet `10.0.0.0/28`, Filestore\nrecognizes and applies the rule for the smaller subnet first. The other rule is\nthen applied to the remaining portions of the defined IP address subnet. In this\nexample, a client using the IPv4 address `10.0.0.20` is granted read and write\npermissions, while a client using `10.0.0.12` is granted read-only permissions: \n\n```\n {\n \"--file-share\":\n {\n \"capacity\": \"2048\",\n \"name\": \"my_vol\",\n \"nfs-export-options\": [\n {\n \"access-mode\": \"READ_WRITE\",\n \"ip-ranges\": [\n \"10.0.0.0/24\"\n ],\n \"squash-mode\": \"ROOT_SQUASH\",\n \"anon_uid\": 1003,\n \"anon_gid\": 1003\n },\n {\n \"access-mode\": \"READ_ONLY\",\n \"ip-ranges\": [\n \"10.0.0.0/28\"\n ],\n \"squash-mode\": \"NO_ROOT_SQUASH\"\n }\n ]\n }\n}\n```\n\nSome restrictions apply:\n\n- Overlapping permissions for identical IPv4 subnets are not supported and return\n an error.\n\n- Overlapping permissions are not supported for basic SSD or basic HDD instances.\n\nWhat's next\n-----------\n\n- [Configure IP-based access control](/filestore/docs/creating-instances#configure_ip-based_access_control) or see an [example](/filestore/docs/creating-instances#example_2).\n- [Creating instances](/filestore/docs/creating-instances).\n- [Edit instances](/filestore/docs/editing-instances).\n- [Troubleshoot common Filestore networking or connection issues](/filestore/docs/troubleshooting)."]]