登录远程 App Engine 实例时是否可以使用 ED25519 代替 RSA?

当 Google Cloud SDK (gcloud) 用户执行时:

gcloud app instances ssh \
$AEF_INSTANCE_ID \
--project $GCP_PROJECT_NAME \
--service $AEF_APP_SERVICE_NAME \
--version $AEF_APP_VERSION_NAME

#=>

WARNING: The private SSH key file for gcloud does not exist.
WARNING: The public SSH key file for gcloud does not exist.
WARNING: You do not have an SSH key for gcloud.
WARNING: SSH keygen will be executed to generate a key.
Generating public/private rsa key pair.
. . .

首次生成 RSA 密钥:

ls -1 ~/.ssh/google_compute_*

#=>

google_compute_engine
google_compute_engine.pub
google_compute_known_hosts

此时是否可以使用 ED25519 代替 RSA?

wanglili19860813 回答:登录远程 App Engine 实例时是否可以使用 ED25519 代替 RSA?

目前,在登录正在运行的 App Engine 柔性环境 (AEF) 实例时,不能使用基于 ED25519 的密钥而不是基于 RSA 的密钥。

换句话说,如果您要:

  1. 删除旧的 RSA 密钥:

    rm ~/.ssh/google_compute_*
    
  2. 生成一个 ED25519 密钥:

    ssh-keygen -t ed25519 -C "$(whoami)@$(hostname)
    
    #=>
    
    Generating public/private ed25519 key pair.
    . . .
    

    注意:当提示输入密钥文件名和位置时,使用绝对路径;使用相对路径返回以下错误:

    保存密钥“~/.ssh/google_compute_engine”失败:没有那个文件或目录

  3. 并尝试登录正在运行的 App Engine 柔性环境 (AEF) 实例:

    gcloud app instances ssh \
    $AEF_APP_INSTANCE_ID \
    --project $GCP_PROJECT_NAME \
    --service $AEF_APP_SERVICE_NAME \
    --version $AEF_APP_VERSION_NAME
    

收到以下错误:

错误:(gcloud.app.instances.ssh) INVALID_ARGUMENT:SSH 密钥无效“$(whoami):ssh-ed25519 $ED25519_PUBLIC_KEY $(whoami)”。应为 "[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]" 或 [USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]" }.

如果指定了过期时间,请参考RFC3339的正确格式。

但是,您可以找到针对此 here 的有效功能请求。

本文链接:https://www.f2er.com/352.html

大家都在问