Providing Credentials for CQLSH
Provide a username and password to connect to a node on an authentication enabled DataStax Enterprise cluster using credentials:
Stored in the
Specified by command line options
Debugging cqlsh authentication
If problems occur while authenticating, then use the --debug option to show CQL shell settings and connection details.
cqlshrcfile. The location of this file depends on the type of installation:
Set credentials in the
Create or modify the
~/.cassandra/cqlshrcfile by adding an
[authentication]section with a
[authentication] username = <role_name> password = <password>
cqlshrc.samplefor an example.
Save the file in
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.
On the command line:
Prompt for password
cqlsh -u <user_name>
cqlsh -u <user_name> -p <password>