-1

I am using Ansible to SSH into a digital ocean instance to deploy some scripts, and I want to publish my playbook on git, but I cannot unless the SSH keys are encrypted.

I encrypted the keys using ansible-vault encrypt (privatekey), but when I attempt to connect (using ansible-playbook --ask-vault-pass main.yml), it gives me incorrect format error (because it reads the encrypted key, which isn't being decrypted because of permissions).

Granting the key permission 644 using "chmod 644 privatekey" makes it possible for ansible vault to decrypt and read the key, but the SSH connection can't be made because the permissions are now too open, and it needs permission 400.

I am going in a loop of trying to find the correct permissions. Help would be greatly appreciated!

I have tried to change the permissions, but I can't find the correct ones.

0 Answers0