# Get filesystems and access policies (if any)awsefsdescribe-file-systemsawsefsdescribe-file-system-policy--file-system-id<id># Get subnetworks and IP addresses where you can find the file systemawsefsdescribe-mount-targets--file-system-id<id>awsefsdescribe-mount-target-security-groups--mount-target-id<id>awsec2describe-security-groups--group-ids<sg_id># Get other access pointsawsefsdescribe-access-points# Get replication configurationsawsefsdescribe-replication-configurations# Search for NFS in EC2 networkssudonmap-T4-Pn-p2049--open10.10.10.0/20# or /16 to be sure
sudomkdir/efs## Mount foundsudoaptinstallnfs-commonsudomount-tnfs4-onfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport<IP>://efs## Mount with efs type## You need to have installed the package amazon-efs-utilssudoyuminstallamazon-efs-utils# If centossudoapt-getinstallamazon-efs-utils# If ubuntusudomount-tefs<file-system-id/EFSDNSname>://efs/
IAM 访问
默认情况下,任何具有对 EFS 的网络访问的人都能够挂载、读取和写入它,即使是根用户。然而,文件系统策略可能会限制仅允许具有特定权限的主体访问它。
例如,如果您没有 IAM 权限,这个文件系统策略将不允许挂载文件系统:
sudomkdir/efssudomount-tefs-otls,iam<file-system-id/EFSDNSname>://efs/# To use a different pforile from ~/.aws/credentials# You can use: -o tls,iam,awsprofile=namedprofile