New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload failed: scp: /etc/init.d/sample: Permission denied in file provisioning #8238
Comments
@alexraju your user ("centos") most likely has no permission to write files under the /etc/init.d directory directly. This is not an issue in Terraform as far as I can tell. |
Correct. If your SSH user doesn't have access, what we recommend is using the file provisioner to upload to a place you can, then the remote shell provisioner to |
@mitchellh I'm already following the method mentioned in your comment. |
@alexraju the "centos" user most likely has a You need to copy your script into the |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Terraform Version
Terraform v0.7.0
Affected Resource(s)
Terraform Configuration Files
resource "null_resource" "sample" {
connection {
host = "${aws_instance.abc.public_ip}"
user = "centos"
agent = true
}
provisioner "file" {
source = "${path.module}/startup-script.sh"
destination = "/etc/init.d/sample"
}
Debug Output
The text was updated successfully, but these errors were encountered: