How to Install Google Cloud Storage tool GSUTIL on Linux CentOS
gsutil is a Python application that lets you access Google Cloud Storage from the command line.
You can use gsutil to do a wide range of bucket and object management tasks, including:
Creating and deleting buckets.
Uploading, downloading, and deleting objects.
Listing buckets and objects.
Moving, copying, and renaming objects.
Editing object and bucket ACLs.
Lets go ahead and see how we can install gsutil on a CentOS Linux Machine.
Download and unzip the gsutil tool using the wget Linux utility from https://storage.googleapis.com/pub/gsutil.tar.gz
see example:
Once unzipped go ahead and ad the PATH environment variable to your .bashrc file.
run the following command.
Test that the gsutil was installed:
Set Up Credentials to Access Protected Data
Installing gsutil allows you to download and access publicly-accessible objects, but in order to access protected data or write to a protected bucket, you need to set up credentials to access the Google Cloud Storage service.
The first time you run this command, gsutil prints a URL to the authorization page where you can authorize gsutil to access Google Cloud Storage.
See steps to follow:
Run the gsutil config command
Copy and paste the URL into a browser window.
Click the Allow Access button.
Copy the authorization code that appears on the next page into the gsutil prompt and press Enter.
Log in to the Google Cloud Platform Console to find a project ID you can specify as the default project.
Copy and paste the project ID into gsutil.
See example:
Test that the gsutil installation:
run the unit test(is faster).
Your gsutil tool should be ready to use, in the next article we will see how we can use the gsutil tool to manage our Google Storage buckets.