Have you locked yourself out of your Vertica cluster, but still have SSH or console access to the servers themselves? If you’re using the default authentication method (not LDAP/Kerberos/GSS), you can temporarily use the “trust” Vertica client authentication method and reset the password. The steps to do so are detailed below. We’ll assume that you’re trying to reset the “dbadmin” user password to “test123” on a single-node test cluster, and that the database has not yet been started.
Note: this method is only recommended for non-production systems on private networks. Use at your own risk.
- Log onto the server as the dbadmin system user. If you’ve lost the dbadmin system password, log in as root and reset it using the “passwd” command. If you do not have access to root, you’ll need to use a method such as this one to regain access to the system root account.
- As dbadmin, run “admintools”
- Select “View Database Cluster State” from the main menu and ensure that the database is not started. If it is, the easiest thing to do is to simply reboot the server.
- After verifying the database is down, select “Configuration Menu” from the main menu in admin tools
- Select “Edit Authentication” and select the database
- Add the following line to enable trust authentication for local connections:
ClientAuthentication = local all trust
- Save the file and quit (“:wq” + ENTER in VI)
- Return to the main menu and select “Start Database”
- Run “vsql -U dbadmin”. It should not prompt for a password.
- Execute the following query:
ALTER USER dbadmin IDENTIFIED BY 'test123';
- Quit vsql (“q”)
- In admin tools, return to “Configuration Menu”
- Select “Edit Authentication” and select the database
- Remove the line that you added in step #6, then save & quit (“:wq” + ENTER in VI)
- Return to the main menu, then select “Stop Database”
- After the database has stopped, select “Start Database”
To read more about the trust client authentication method and implementing security in a Vertica cluster, check out the Implementing Security section of the Vertica 6.0 Administrator’s Guide, available for download from MyVertica.