Difference between revisions of "Gsutil acl set"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
{{lc}}
 
{{lc}}
 
  [[gsutil acl]] set
 
  [[gsutil acl]] set
 +
=== Set ===
 +
 +
The "acl set" command allows you to set an Access Control List on one or more buckets and objects. The file-or-canned_acl_name parameter names either a canned ACL or the path to a file that contains ACL text. The simplest way to use the "acl set" command is to specify one of the canned ACLs, e.g.,:
 +
 +
* <code>gsutil acl set private gs://bucket</code>
 +
 +
If you want to make an object or bucket publicly readable or writable, it is recommended to use "acl ch", to avoid accidentally removing OWNER permissions. See the "acl ch" section for details.
 +
 +
See Predefined ACLs for a list of canned ACLs.
 +
 +
If you want to define more fine-grained control over your data, you can retrieve an ACL using the "acl get" command, save the output to a file, edit the file, and then use the "acl set" command to set that ACL on the buckets and/or objects. For example:
 +
 +
 +
* <code>gsutil acl get gs://bucket/file.txt > acl.txt</code>
 +
 
  [[gsutil acl set private]]
 
  [[gsutil acl set private]]
  

Revision as of 10:10, 1 August 2022

gsutil acl set

Set

The "acl set" command allows you to set an Access Control List on one or more buckets and objects. The file-or-canned_acl_name parameter names either a canned ACL or the path to a file that contains ACL text. The simplest way to use the "acl set" command is to specify one of the canned ACLs, e.g.,:

  • gsutil acl set private gs://bucket

If you want to make an object or bucket publicly readable or writable, it is recommended to use "acl ch", to avoid accidentally removing OWNER permissions. See the "acl ch" section for details.

See Predefined ACLs for a list of canned ACLs.

If you want to define more fine-grained control over your data, you can retrieve an ACL using the "acl get" command, save the output to a file, edit the file, and then use the "acl set" command to set that ACL on the buckets and/or objects. For example:


  • gsutil acl get gs://bucket/file.txt > acl.txt
gsutil acl set private

See also

Advertising: