简体   繁体   中英

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?

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

Your credentials do not expire (ie 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.

I wonder if an admin has enabled a session duration.

Maybe you need to set it to be longer here: https://admin.google.com/ac/security/reauth/admin-tools

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM