Introduction
Expected Outcome
Regain access to the Administrator account in Terraform Enterprise.
Prerequisites
- Terraform Enterprise: all releases
Use Case
- You are unable to login as the Administrator to your Terraform Enterprise instance.
- Promoting another account as Site Admin is not an option.
Procedure
-
SSH into your Terraform Enterprise instance.
- Launch the Rails console.
For Terraform Enterprisesudo docker exec -it ptfe_atlas /usr/bin/init.sh /app/scripts/wait-for-token -- bash -i -c 'cd /app && ./bin/rails c'
v202205-1
throughv202308-1
:sudo docker exec -it tfe-atlas /usr/bin/init.sh /app/scripts/wait-for-token -- bash -i -c 'cd /app && ./bin/rails c'
- For Terraform Enterprise
v202309-1
and above running inconsolidated_services
mode:sudo docker exec -it terraform-enterprise tfectl support console
-
Find the Administrator account and store it in the user variable.
user = User.find_by(username: 'administrator')
-
Change the password for the user. Password requires 10 characters minimum.
user.password = 'yournewadminpass'
- Save your changes and exit the Rails console.
user.save!
exit - You should now be able to login via the Terraform Enterprise Web UI with your new password. If two factor authentication was setup for the Administrator account you will be prompted for the code.