【问题标题】:How to auto insert input on gcloud linux command如何在 gcloud linux 命令上自动插入输入
【发布时间】:2016-02-25 11:54:51
【问题描述】:

从我的代码运行这个命令:

gcloud compute copy-files --zone "$ZONE" "$USER@$SERVER_NAME":"$REMOTE_DIR_LOCATION" "$LOCAL_DIR_LOCATION"

我收到这条消息,我想为此自动按“输入”3 次

WARNING: You do not have an SSH key for Google Compute Engine.
WARNING: [/usr/bin/ssh-keygen] will be executed to generate a key.
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):

如何将参数传递给 gcloud 程序以表明我希望它在没有我手动确认的情况下生成证书。

附言。这样做是因为我的服务器是动态创建的(所以我不能一次为所有服务器做一次)。

PS2 - 也许这是一个 linux 问题,而不是特定于 gcloud。我也愿意接受这方面的创意。

【问题讨论】:

    标签: linux bash gcloud gcloud-cli


    【解决方案1】:

    --quiet 标志与gcloud compute ssh 命令一起使用将为您完成此操作。

    一般来说,您希望 --quiet 标志用于非交互式 gcloud 使用。

    【讨论】:

      猜你喜欢
      • 2013-04-08
      • 2021-04-14
      • 2020-10-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多