Provide credentials for CQLSH
Provide a username and password to connect to a node on an authentication enabled HCD cluster using credentials:
-
Stored in the
cqlshrc
file -
Specified by command line options
Where is the cassandra.yaml
file?
The location of the cassandra.yaml
file depends on your installation type.
-
Package installations
-
Tarball installations
/etc/hcd/cassandra
INSTALLATION_LOCATION/resources/cassandra/conf
Replace INSTALLATION_LOCATION with the path where you extracted the HCD tarball.
- Tarball installations
-
INSTALLATION_LOCATION/resources/cassandra/conf
Replace INSTALLATION_LOCATION with the path where you extracted the HCD tarball.
-
Set credentials in the
cqlshrc
file:-
Create or modify the
~/.cassandra/cqlshrc
file by adding an[authentication]
section with ausername
andpassword
.[authentication] username = <role_name> password = <password>
See
cqlshrc.sample
for an example. -
Save the file in
<$HOME>/.cassandra
directory. -
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_history
to ensure that plain text passwords are not compromised.
-
-
On the command line:
-
Prompt for password
cqlsh -u <user_name>
-
No prompt
cqlsh -u <user_name> -p <password>
-
-