Permission denied - keypair

I am getting below error. I created the key as root and created the terraform files as different user. I tried to chmod 600 but still get the same error. 

Getting this error when i did terraform plan

aws_key_pair.wp_auth: file: open /root/.ssh/ permission denied in:

Please suggest, how to resolve the issue

  • post-author-pic
    Terrence C

    The command 'chmod 600' for that file will mean that ONLY root can access it. So if the key is owned by root and the terraform files by another user (assuming the same user is running the job(s)), then the keyfile will not be accessible by that user since only root can access it.

    You can either run as root, use sudo, or create another key and associate with that user.

Looking For Team Training?

Learn More