Providing Credentials for CQLSH
Provide a username and password to connect to a node on an authentication enabled DataStax Enterprise (DSE) cluster using credentials stored in the cqlshrc file or specified by command line options.
|
If problems occur while authenticating, then use the |
Use cqlshrc
-
Edit the
cqlshrcfile. The location of this file depends on the type of installation:-
Package installations:
/etc/dse/cassandra -
Tarball installations:
<installation_location>/resources/cassandra/conf
-
-
Create or modify the
~/.cassandra/cqlshrcfile by adding an[authentication]section with ausernameandpassword:[authentication] username = <role_name> password = <password>See
cqlshrc.samplefor an example. -
Save the file in
<$HOME>/.cassandradirectory. -
Set permissions on the file to prevent unauthorized access, because the password is stored in plain text:
chmod 440 <$HOME>/.cassandra/cqlshrc -
Check the permissions on
<$HOME>/.cassandra/cqlshrc_historyto ensure that plain text passwords are not compromised. -
Start
cqlsh.cqlsh
Use command line options
Start cqlsh and provide authentication credentials.
If you provide only the username, then cqlsh prompts for the password:
cqlsh -u <user_name>
If you provide both the username and password, then cqlsh uses the provided credentials to connect to the node:
cqlsh -u <user_name> -p <password>