Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page fournit des instructions sur les tâches courantes de la fonctionnalité Redis AUTH dans Memorystore pour Redis. Pour en savoir plus sur la fonctionnalité AUTH, consultez la page Présentation de la fonctionnalité AUTH.
Pour obtenir la liste des autorisations dont l'utilisateur a besoin pour effectuer les tâches AUTH mentionnées dans ce document, consultez la section Autorisations de Redis AUTH de cette page.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (UTC)."],[],[],null,["# Manage Redis AUTH\n\n| **Note:** If you are looking for the Memorystore for Redis Cluster documentation, see [Manage IAM authentication](/memorystore/docs/cluster/manage-iam-auth).\n\nThis page gives instructions on common tasks for the [Redis AUTH](https://redis.io/commands/auth)\nfeature on Memorystore for Redis. For details on what the AUTH feature\nprovides, see [AUTH feature overview](/memorystore/docs/redis/auth-overview).\n\nFor a list of permissions a user needs in order to perform the AUTH tasks on\nthis page, see [Redis AUTH permissions](/memorystore/docs/redis/access-control#redis_authentication_permissions).\n\nCreating a Redis instance with AUTH enabled\n-------------------------------------------\n\n### Console\n\nWhen you [create a Redis instance](/memorystore/docs/redis/create-manage-instances#creating_a_redis_instance_on_a_vpc_network), select\n**Enable AUTH** .\n\n### gcloud\n\nEnter the following command, replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate\nvalues: \n\n```\ngcloud redis instances create instance-id --enable-auth --size=size --region=region --zone=zone --redis-version=version\n```\n\nEnabling/disabling AUTH on an existing Redis instance\n-----------------------------------------------------\n\n**Note:** AUTH string credentials are not confidential when transmitted. See [AUTH feature overview](/memorystore/docs/redis/auth-overview) for more details. \n\n### Console\n\n1. Go to the **Memorystore for Redis** page in the Google Cloud console.\n\n [Memorystore for Redis](https://console.cloud.google.com/memorystore/redis/instances?)\n2. View your instance's *Instance details* page by clicking on your *Instance\n ID*.\n\n3. Click the **Edit** button.\n\n4. Find the AUTH section.\n\n - If you want to enable AUTH, select checkbox labeled **Enable\n AUTH**.\n\n - If you want to disable AUTH, deselect the checkbox labeled\n **Enable AUTH**.\n\n5. Click the **Save** button.\n\n### gcloud\n\n1. Enable AUTH for your instance by running the following command,\n replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate values:\n\n ```\n gcloud redis instances update instance-id --enable-auth --region=region\n ```\n2. Disable AUTH for your instance by running the following command,\n replacing \u003cvar translate=\"no\"\u003evariables\u003c/var\u003e with appropriate values:\n\n ```\n gcloud redis instances update instance-id --no-enable-auth --region=region\n ```\n\nGetting the AUTH string\n-----------------------\n\n### Console\n\n1. Go to the **Memorystore for Redis** page in the Google Cloud console.\n\n [Memorystore for Redis](https://console.cloud.google.com/memorystore/redis/instances?)\n2. View your instance's *Instance details* page by clicking on your *Instance\n ID*.\n\n3. Find the **AUTH string** value in the **Security** section.\n\n### gcloud\n\n1. Get the AUTH string by copying it from the response body returned by the\n following command:\n\n ```\n gcloud redis instances get-auth-string instance-id --region=region\n ```\n\nChanging the AUTH string\n------------------------\n\nFollow the steps below to change the AUTH string to a new value:\n\n1. Disable AUTH:\n\n ```\n gcloud redis instances update instance-id --no-enable-auth --region=region\n ```\n2. Enable AUTH:\n\n ```\n gcloud redis instances update instance-id --enable-auth --region=region\n ```\n | **Note:** This step interrupts your client's authenticated connection because a new AUTH string is generated, invalidating the previous AUTH string.\n3. Get the new AUTH string:\n\n ```\n gcloud redis instances get-auth-string instance-id --region=region\n ```\n4. In your application, replace the old AUTH string with the new AUTH string\n and reconnect your client.\n\nConnecting to a Redis instance with AUTH\n----------------------------------------\n\nTo use AUTH and `redis-cli` to connect to your instance, see [Connecting to a Redis instance that uses AUTH](/memorystore/docs/redis/connecting-redis-instance#connecting_to_a_redis_instance_that_uses_auth).\n\nWhat's next\n-----------\n\n- View the [AUTH feature overview](/memorystore/docs/redis/auth-overview)."]]