![如何在 Google Cloud 中重置密码?](https://linux22.com/image/735878/%E5%A6%82%E4%BD%95%E5%9C%A8%20Google%20Cloud%20%E4%B8%AD%E9%87%8D%E7%BD%AE%E5%AF%86%E7%A0%81%EF%BC%9F.png)
我正在尝试使用 Putty 连接到 Google Cloud。我让公钥/私钥正常工作,但当我连接时,它会要求输入密码。它不会接受私钥或我的 Google 登录或我的电子邮件登录的密码。我尝试重置密码或最好使用控制台禁用密码提示。以下所有输入均未成功,并导致一系列错误消息,包括:
Positional argument deprecated_host has been removed. Use --host instead.
如何重设或取消密码?
gcloud sql users set-password james_celentano –instance=instance-1 --prompt-for-password=off
Big problems “Positional argument deprecated_host has been removed”
gcloud sql users set-password --host –instance=instance-1 --prompt-for-password=off
现在不喜欢--prompt-for-password=off
gcloud sql users set-password --host –instance instance-1 -- password=
gcloud sql users set-password --host –instance= instance-1 –i instance-1 -- password=
gcloud sql users set-password james_celentano --host –instance=instance-1 password=
gcloud sql users set-password --host –instance=instance-1 password=
gcloud sql users set-password --host –instance=instance-1 –i=instance-1 password=
答案1
要使用的命令是:
gcloud sql users set-password postgres -i instance_test --prompt-for-password
正如 Google Cloud SDK 中所述文档。
下面是一个示例,我在提示后输入密码,然后使用它连接到数据库引擎。
user@cloudshell:~ (projid)$ gcloud sql users set-password postgres -i instance_test --prompt-for-password
Instance Password:
Updating Cloud SQL user...done.
user@cloudshell:~ (projid)$ gcloud sql connect dbtest -u postgres
Whitelisting your IP for incoming connection for 5 minutes...done.
Connecting to database with SQL user [postgres].Password for user postgres:
psql (9.6.11, server 9.6.10)
SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES128-GCM-SHA256, bits: 128, compression: off)
Type "help" for help.
postgres-> \q