Creating user passwords

hello -

is there any way to set a password? i dont see the option listed under the “grants” documentation.

or does cockroachdb even use passwords? it seems like a user is created merely by issuing a GRANT.

Yes, this feature was released just today, in fact, but the docs have not yet been updated.

You can use the CREATE USER statement or the cockroach user set command to create a user with a password. Here are some examples from our tests.

It used to be the case that you would sort of invent a user just by granting the user privileges, but going forward, you should create the user before creating certs for the user or granting privileges to the user.

@Sean, once the password-based auth docs are live, please update this thread.


Hi Jesse,

Is there a way to also DROP users?

@fudge21, you can remove users with this command: cockroach user rm <username>

The user and password-based authentication docs will be published with the next beta release, likely next week. But if you’d like to look at the PR in the meantime, it’s here.

@edwardsmarkf Glad to say that we release support for password-based authentication in our last beta. Check out our docs for CREATE USER (SQL) and cockroach user (command line––in particular, check out the section on User Authentication).