Advertisement

Responsive Advertisement

How to create service accounts (sa) On Windows, MacOS, Linux Free (Bypass Google Drive 750GB/Day)

 Credit @MsGsuite


How to create service accounts (sa) On Windows, macOS, Linux Free (Bypass Google Drive 750GB/Day)


Why are service accounts useful

The service accounts can be used to bypass the 750Gb/day upload limit set by google in google drive. It means that you can use them to upload more than 750Gb per day, duplicate hundreds of files...

Each service account has a 750Gb upload limit per day. You can create up to 100 service accounts per google cloud project. So, with only one project you can upload/duplicate up to 75Tb a day!



⚙️ How to create the accounts


🎬 Video tutorial: YouTube


  • Go to the Google Cloud Console and if you don't have an existing project, create a new one
  • Then, enable the google drive api
  • Go to the OAuth Consent Screen and select "External" and click on "Create"
  • Fulfil all required information (the one with a red *) and click on "Save and Continue" 3 times (the "Scopes" and "Test users" parts do not require any inputs)
  • Click on publish and validate
  • On the credentials tab, click on "Create Credentials" then "OAuth client ID", select "Desktop app"
  • Click on the download button on the right of your OAuth Client IDs and save the file with the following name: credentials.json
  • Download and install python on your computer and then download this script into the same folder than the credentials.json file.
  • Create a folder named "accounts" (the generated accounts will be downloaded there)
  • To make the script work, download the requirements.txt file and run pip3 install -U -r requirements.txt
  • To create the accounts, you have different choices, but remember that a single sa can copy 750Gb a day and 1 project makes 100 sa so 750*100 = 75Tb a day. Creating too many sa accounts is useless.
If you want to create some service accounts using existing projects (do not create more projects), run py gen_sa_accounts.py --quick-setup -1

⚠️ This will overwrite the existing service accounts.


To create service accounts by creating a new project run : py gen_sa_accounts.py --quick-setup 1 replace "1" with the number of projects you want

⚠️This command creates services accounts in all existing projects even the projects that will be deleted.

  • After executing the code, follow the instructions...

If everything goes right, you should have at least 100 files in your "account" folder. Each file corresponds to one service account.




📦 Add service accounts into a shared drive (team drive)

  • In order to manage the files (copy, duplicate...) into your shared drives with the service accounts, you must create a google group (configure it as you which)



Now, to get the email addresses of the service accounts, there are multiple ways to do it:

1️⃣ Method 1:

Windows users
  • Open PowerShell and cd into the folder where you have the sa (the .json files)
  • Run: $emails = Get-ChildItem .\**.json |Get-Content -Raw |ConvertFrom-Json |Select -ExpandProperty client_email >>emails.txt
Linux / MacOS users
  • Run: grep -oPh '"client_email": "\K[^"]+' *.json > emails.txt
Now for everyone:
  • Open the emails.txt file, copy all the email addresses and add them to the google group you've just created.

Note: You can add only 100 sa/members each 24h in a google group.

  • Now add your google group email address to your team drive!


2️⃣ Method 2:

  • Add the Email Extractor extension into your browser: Chrome | Firefox
  • Go to the google cloud console, select your project with the service accounts and go to the credentials tab (you should see the service accounts)
  • Scroll into the bottom of the page and under "Rows per page:" select 100
  • Open the extension and copy all the email addresses (except yours) and add them to the google group you've just created.
You can add only 100 sa/members each 24h in a google group.
  • Now add your google group email address to your team drive!

Post a Comment

4 Comments

  1. Error 400: invalid_request
    :(

    ReplyDelete
    Replies
    1. go to google could console and don't publish your app and add your email on add user option then refresh your error 400 page

      Delete
  2. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Unlimited storage bypass (750 GB) only work of mirror bot and rclone

      Delete