Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can "gcloud auth login" remember me for at least a day?

I run "gcloud auth login" and then do some stuff, but after some time (~1hr or so) I have to run it again because otherwise I am not authenticated.

Is it normal? Can gcloud authentication remember me for a longer period?

like image 874
Alex Pak Avatar asked Mar 19 '23 18:03

Alex Pak


1 Answers

It's not expected behavior, no. As per the documentation

Your credentials do not expire (i.e. you should not need to re-run this command), but you can repeat this process as many times as you'd like to add more accounts.

I'd recommend making sure that you're not clearing or deleting any of the following directories, as this is where everything is stored:

All credential information is stored in the directory $CLOUDSDK_CONFIG/credentials (or %CLOUDSDK_CONFIG%\credentials on Windows), where CLOUDSDK_CONFIG=$HOME/.config/gcloud on Linux and Mac, and %APPDATA%\gcloud on Windows.

Also, try listing and setting the appropriate accounts with the commands recommended on the linked document.

like image 120
Albert Avatar answered Apr 02 '23 19:04

Albert