Change Secrets and Passwords (Required)¶
Last Updated: November 2021
The default secret key and passwords should be changed to secure the VM immediately after provisioning it.
Change Secret Key¶
The portal_config.yml has been configured with a default SECRET_KEY that should be changed. Use a tool like RandomKeygen to generate a new key (e.g.: CodeIgniter Encryption Key or 256-bit WEP Key). Update the SECRET_KEY value as follows:
tethys settings --set SECRET_KEY <new_key>
Restart the Tethys service afterward:
sudo systemctl restart tethys
Change Passwords¶
All user accounts have default passwords that should be changed to secure passwords soon after creating the VM. Use a password generator like xkpasswd or similar to create strong and unique passwords for the following accounts:
Tethys User Account
Tethys Portal Admin User
Database Users (postgres, tethys_default, tethys_super)
Warning
Failure to change the passwords on your Tethys Portal server will make it vulnerable to attack! Do not keep the default passwords!
Tethys User¶
If you did not change the password of the tethys user in the Orientation to Azure VM tutorial, do so now:
sudo passwd tethys
Database Users¶
Change the passwords for the database users as follows:
Start
psqlas thepostgresuser:sudo su - postgres -c psql
Use
ALTER USERqueries to change the passwords:ALTER USER <user_name> WITH PASSWORD '<new_password>';
Quit
psql:\qUpdate Tethys
portal_config.yml:tethys settings --set DATABASES.default.PASSWORD <tethys_default_password>
Restart the tethys service to apply the changes to
portal_config.yml:sudo systemctl restart tethys.service
Tethys Portal Admin¶
Create a new portal admin account and delete the default account as follows:
Run the
createsuperusercommand:tethys db createsuperuser --pn <username> --pe <email> --pp <password>
Log in to the Tethys Portal with the new admin account.
Select Site Admin from the dropdown menu at the top-right.
Click on the Users link under the AUTHENTICATION AND AUTHORIZATION section.
Check the box next to the admin user and
Select Delete selected users from the Actions dropdown and press the Go button.
Figure 1. Delete the default admin user account.¶