Я пытаюсь создать виртуальную машину в Azure с помощью terraform и скопировать файл с локальной машины на удаленную виртуальную машину на Azure.
os_profile {
computer_name = "pdemo"
admin_username = "ubuntu"
}
os_profile_linux_config {
disable_password_authentication = true
ssh_keys {
key_data = "ssh-rsa ********************************** "
path = "/home/ubuntu/.ssh/authorized_keys"
}
}
provisioner "file" {
connection {
type = "ssh"
user = "ubuntu"
host = azurerm_public_ip.terraform-PUBLIC-IP.ip_address
private_key = file("/home/ubuntu/.ssh/id_rsa")
}
source = "/home/ubuntu/.ssh/terraform.pub"
destination = "/home/ubuntu/.ssh/terraform.pub"
}
}
Выдает ошибку:
azurerm_virtual_machine.terraform-app-VM: Still creating... [1m30s elapsed]
azurerm_virtual_machine.terraform-app-VM: Still creating... [1m40s elapsed]
azurerm_virtual_machine.terraform-app-VM: Still creating... [6m20s elapsed]
azurerm_virtual_machine.terraform-app-VM: Still creating... [6m30s elapsed]
Error: timeout - last error: SSH authentication failed (ubuntu@:22): ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain