Password file authentication#

Trino can be configured to enable frontend password authentication over HTTPS for clients, such as the CLI, or the JDBC and ODBC drivers. The username and password are validated against usernames and passwords stored in a file.

Password file authentication is very similar to LDAP authentication. Please see the LDAP documentation for generic instructions on configuring the server and clients to use TLS and authenticate with a username and password.

Using TLS and a configured shared secret is required for password file authentication.

Password authenticator configuration#

To enable password file authentication, set the password authentication type in etc/


In addition, create a etc/ file on the coordinator with the file authenticator name:

The following configuration properties are available:




Path of the password file.


How often to reload the password file. Defaults to 5s.


Max number of cached authenticated passwords. Defaults to 1000.

Password files#

File format#

The password file contains a list of usernames and passwords, one per line, separated by a colon. Passwords must be securely hashed using bcrypt or PBKDF2.

bcrypt passwords start with $2y$ and must use a minimum cost of 8:


PBKDF2 passwords are composed of the iteration count, followed by the hex encoded salt and hash:


Creating a password file#

Password files utilizing the bcrypt format can be created using the htpasswd utility from the Apache HTTP Server. The cost must be specified, as Trino enforces a higher minimum cost than the default.

Create an empty password file to get started:

touch password.db

Add or update the password for the user test:

htpasswd -B -C 10 password.db test

Verify configuration#

To verify password file authentication, log in to the Web UI, and connect with the Trino CLI to the cluster:

  • Connect to the Web UI from your browser using a URL that uses HTTPS, such as Enter a username in the Username text box and the corresponding password in the Password text box, and log in to the UI. Confirm that you are not able to log in using an incorrect username and password combination. A successful login displays the username in the top right corner of the UI.

  • Connect with the Trino CLI using a URL that uses HTTPS, such as with the addition of the --user and --password properties:

./trino --server --user test --password

The above command quotes you for a password. Supply the password set for the user entered for the --user property to use the trino> prompt. Sucessful authentication allows you to run queries from the CLI.

To test the connection, send a query:

trino> SELECT 'rocks' AS trino;

(1 row)

Query 20220919_113804_00017_54qfi, FINISHED, 1 node
Splits: 1 total, 1 done (100.00%)
0.12 [0 rows, 0B] [0 rows/s, 0B/s]