ApsaraDB for Redis supports password-free access in Virtual Private Cloud (VPC). This mode provides a secure and more convenient method to connect to the database. To enable password-free access, make sure that the clients and ApsaraDB for Redis instances reside within the same VPC. This way, the clients can access ApsaraDB for Redis instances without using a password. The username and password can also be used to connect to the ApsaraDB for Redis instances.

Prerequisites

The instance runs in a VPC network.
Note If the network type of an instance is classic network, you must switch the network type to VPC. For more information, see Switch to VPC network.

Precautions

  • By default, after password-free access is enabled, you can use the account that has the same name as the instance ID, such as r-bp1zxszhcgatnx****, to connect to the ApsaraDB for Redis instance. This account has read and write permissions to the instance.
  • To ensure security, the password is still required when you connect to an ApsaraDB for Redis instance by using a public endpoint after password-free access is enabled.
    Note If you cannot connect to an ApsaraDB for Redis instance by using a public endpoint, you can upgrade the minor version of the instance to the latest version. For more information, see Upgrade the minor version.
  • To connect to an ApsaraDB for Redis instance without a password, make sure that the client and the instance reside within the same VPC. The VPC IP address of the client must be added to a whitelist of the instance. For more information, see Set IP address whitelists.
    Note To ensure security, do not enter 0.0.0.0/0 in whitelists. This CIDR block enables all access to the instance.

Procedure

  1. Log on to the ApsaraDB for Redis console.
  2. On the top of the page, select the region where the instance is deployed.
  3. On the Instances page, click the Instance ID of the instance.
  4. On the right side of Connection Information, click Enable Password-free Access.
    Figure 1. Enable Password-free Access
    Enable Password-free Access
  5. In the message that appears, read the prompt and click OK.
    After you refresh the page, the Enable Password-free Access button changes to Disable Password-free Access. You can click this button to disable password-free access.
    Note If the password-free access feature is disabled, clients that are connected to the ApsaraDB for Redis instance can no longer connect to the instance. To avoid affecting client connection, you must change the authentication mode of the clients to the username and password.

Password-free connection example

The Redis command line interface redis-cli is used in this example. After you enable password-free access, enter the redis-cli -h <host> -p <port> command to connect to your client without a password, such as redis -h r-bp10noxlhcoim2****.redis.rds.aliyuncs .com -p 6379.
Figure 2. Example
Example

For more information, see Use redis-cli to connect to ApsaraDB for Redis.

Related operations

Operation Description
ModifyInstanceVpcAuthMode Specifies whether to enable password-free access in VPC.