auth.3valkey - Man Page
Authenticates the connection.
Synopsis
AUTH
[username] password
Description
The AUTH command authenticates the current connection using the valkey-acl(7) Valkey ACL system.
The standard way to AUTH
is the two-argument form:
AUTH <username> <password>
This authenticates the current connection with one of the users defined in the ACL list (see ACL SETUSER
and the official valkey-acl(7) ACL guide for more information).
When the single argument form of the command is used, where only the password is specified, it is assumed that the implicit username is “default”.
AUTH <password>
This form authenticates against the “default” user’s password set with requirepass
.
If the password provided via AUTH matches the password in the configuration file, the server replies with the OK
status code and starts accepting commands. Otherwise, an error is returned and the clients needs to try a new password.
Security notice
Because of the high performance nature of Valkey, it is possible to try a lot of passwords in parallel in very short time, so make sure to generate a strong and very long password so that this attack is infeasible. A good way to generate strong passwords is via the ACL GENPASS
command.
Reply
valkey-protocol(7) Simple string reply: OK
, or an error if the password, or username/password pair, is invalid.
Complexity
O(N) where N is the number of passwords defined for the user
Acl Categories
@connection @fast
History
- Available since: 1.0.0
- Changed in 6.0.0: Added ACL style (username and password).
See Also
client(3valkey), client-caching(3valkey), client-capa(3valkey), client-getname(3valkey), client-getredir(3valkey), client-help(3valkey), client-id(3valkey), client-info(3valkey), client-kill(3valkey), client-list(3valkey), client-no-evict(3valkey), client-no-touch(3valkey), client-pause(3valkey), client-reply(3valkey), client-setinfo(3valkey), client-setname(3valkey), client-tracking(3valkey), client-trackinginfo(3valkey), client-unblock(3valkey), client-unpause(3valkey), echo(3valkey), hello(3valkey), ping(3valkey), reset(3valkey), select(3valkey)