我使用具有以下数据库系统的 terraform 创建了数据库:
resource "oci_database_db_system" "test_db_system" {
availability_domain = data.oci_identity_availability_domains.ADs.availability_domains[0].name
compartment_id = oci_identity_compartment.Compartment.id
database_edition = "STANDARD_EDITION"
db_home {
database {
admin_password = var.db_password
db_name = "database"
pdb_name = "pdb"
db_backup_config {
auto_backup_enabled = false
}
}
db_version = "19.10.0.0"
display_name = "MyTFDBHomeVm"
}
db_system_options {
storage_management = "LVM"
}
shape = "VM.Standard2.2"
subnet_id = oci_core_subnet.ExampleSubnet.id
ssh_public_keys = [ file("C:\\Users\\USERNAME\\.ssh\\PUBLIC_KEY_FILE") ]
display_name = "MyTFDBSystemVM"
hostname = "testhostname"
data_storage_size_in_gb = 256
license_model = "BRING_YOUR_OWN_LICENSE"
node_count = 1
}
然后我尝试使用以下命令 ssh 进入数据库(我在 Windows 10 上,使用 git bash)。公钥来自 oci 控制台中的节点选项卡。
ssh -i /c/Users/USERNAME/.ssh/PRIVATE_KEY oracle@PUBLIC_IP
我收到以下错误
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
我也尝试在 OCI 控制台中生成一个密钥并使用它来连接也不起作用。我尝试的最后一件事是从也正在创建的计算实例中进行 ssh,得到了同样的错误。