Providing credentials on command line
Use switches to provide a username and password from the command line.
DataStax Enterprise (DSE) tools interact directly with the database or use the Java
Management Extension MBeans to get metrics and perform operations. Use the command
line switch that is relative to the type of operation performed by the command.
CAUTION: Each of the tools listed support prompting for the password when
none is provided. Using the option to enter the password on the command line
prompt is a security risk because the password appears in plain text in the
terminal history.
Credentials for database interactions
When DataStax Enterprise database authentication is enabled, you must provide a username and password to run commands that interact with the DSE database.
DSE utilities
DataStax provided utilities typically have the following command line options for
credentials:
dse -u user_name [ -p password] commandWhere the command line options for each supported tool are:
- dse advrep
dse -u username [-p password] advrep command subcommand
dse -u username [-p password] fs
dse -u username [-p password] spark [options]
- dse spark-class
dse -u username [-p password] spark-class options
dse -u username [-p password] spark-submit options
dse -u username [-p password] spark-jobserver options
dse -u username [-p password] spark-history-server options
dse -u username [-p password] spark-sql-thriftserver options
dse -u username [-p password] pyspark options
dse -u username [-p password] spark-sql options
dse -u username [-p password] sparkR options
dse -u username [-p password] client-tool subcommand options
dse -u username [-p password] gremlin-console
Native utilities
The native database utilities typically have the following command line options for
credentials:
command -u username [-pw password] subcommand
Where the command line options for each supported tool are:
nodetool -u username [-pw password] subcommand
sstable_command -u username [-pw password] [options]
cassandra-stress -mode user=username password=password authprovider=auth-provider=com.datastax.driver.core.AuthProvider options
Credentials for Java Management Extensions (JMX) interactions
When JMX authentication is also enabled, commands that use JMX MBeans to verify
status or execute commands require additional credentials. Use the
-a
username and -b password
before the command.
dsetool -a jmx_username [ -b jmx_password] command
Note: When
authentication is enabled, set up permission to access MBeans see Controlling access to JMX MBeans.
- dse advrep
- dsetool status
dse advrep --jmx-user jmx_username [ --jmx-pwd jmx_password] command
CAUTION: Entering the password in plain text from the command line is not
secure; the password may be stored in the terminal history. DataStax recommends
entering the password at the prompt instead of using the password option from
the CLI.