Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recover ansible-vault password in case password is forgotten

Tags:

ansible

I am using ansible-vault to set password protect var/main.yml file. Now I can push my source code in source control system. After that deploys in production server. Suppose somebody manipulate the password or forgot the password. Is there any way to recover ansible-vault password or set the new password again without asking the old password?

Thanks in advance

like image 637
Birendra Kumar Avatar asked Apr 28 '15 11:04

Birendra Kumar


People also ask

How do I recover my ansible Vault password?

You can use rekey keyword in your ansible-vault command. It allows us to reset the password of a vault.

What do I do if I forgot my vault password?

Android or iOSIn the Vault screen, tap the Menu icon , and then tap Settings. In the Settings screen, tap Reset Password. Approve using biometric authentication. In the Reset password screen, follow the on-screen instructions and tap Save.

Where are ansible vault passwords stored?

Storing the Password in a File Be careful with that file, and make sure that if it lives inside the project, it never gets into source control. To tell Ansible where to find this password file, include it in the command, like so: ansible-playbook site. yml --vault-password-file ~/. vault_pass.

How do you change the existing password of ansible vault?

If you need to change the password of an encrypted file, use the ansible-vault rekey command: ansible-vault rekey encrypt_me. txt.


1 Answers

Unless you brute force the password there is no way to recover it.

I suggest you use a password manager to store your password and share the password database within your organization. For example, you could store the password in a password service which has email or SMS reset option to recover the user account, though this might not be very good idea for high security environments.

like image 92
Mikko Ohtamaa Avatar answered Oct 20 '22 10:10

Mikko Ohtamaa