gpt4 book ai didi

amazon-web-services - kops ssh 公钥权限被拒绝

转载 作者:行者123 更新时间:2023-12-02 12:36:16 25 4
gpt4 key购买 nike

我正尝试通过 kops 创建一个集群,按照这些说明 https://github.com/kubernetes/kops/blob/master/docs/cli/kops_create_cluster.md

这是我试过的

export AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
export AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
export KOPS_CLUSTER_NAME=staging.fayzlab.com
export KOPS_STATE_STORE=s3://fayzlab-kops-stat-store

aws s3api create-bucket \
--bucket fayzlab-kops-stat-store \
--region us-east-1

aws s3api put-bucket-versioning --bucket fayzlab-kops-stat-store --versioning-configuration Status=Enabled

kops create cluster \
--zones us-east-1b \
--topology private \
--networking calico \
--api-ssl-certificate arn:aws:acm:us-east-1:679995182974:certificate/b1753864-f1b7-4a51-a008-cb14f07544ab \
--master-size t2.micro\
--master-count 1 \
--node-size t2.micro \
--node-count 1 \
--name ${KOPS_CLUSTER_NAME}

我得到了以下输出

{
"Location": "/fayzlab-kops-stat-store"
}
I0329 17:58:56.299037 32539 create_cluster.go:496] Inferred --cloud=aws from zone "us-east-1b"
I0329 17:58:57.216939 32539 subnets.go:184] Assigned CIDR 172.20.32.0/19 to subnet us-east-1b
I0329 17:58:57.217040 32539 subnets.go:198] Assigned CIDR 172.20.0.0/22 to subnet utility-us-east-1b
Previewing changes that will be made:


SSH public key must be specified when running with AWS (create with `kops create secret --name staging.fayzlab.com sshpublickey admin -i ~/.ssh/id_rsa.pub`)

我创建了一个 key ssh-keygen -t rsa -f ./cluster.fayzlab.com

尝试过

kops create secret sshpublickey admin -i ~/.ssh/cluster.fayzlab.com.pub \
--name staging.fayzlab.com --state s3://fayzlab-kops-stat-store

但是我收到这个错误

error reading SSH public key /home/faiz/.ssh/cluster.fayzlab.com.pub: open /home/faiz/.ssh/cluster.fayzlab.com.pub: permission denied

我已经在网上用尽了所有的选择和资源。请指教。

文件权限

-rw------- 1 faiz faiz 1766 Mar 29 17:51 cluster.fayzlab.com
-rw-r--r-- 1 faiz faiz 391 Mar 29 17:51 cluster.fayzlab.com.pub

最佳答案

选项一

1) 将工作目录更改为

cd ~/.ssh/

2) 然后再次运行如下命令

kops create secret sshpublickey admin -i cluster.fayzlab.com.pub --name staging.fayzlab.com --state s3://fayzlab-kops-stat-store

方案二

提供您的公钥的完整路径,即

kops create secret sshpublickey admin -i /home/faiz/.ssh/cluster.fayzlab.com.pub --name staging.fayzlab.com --state s3://fayzlab-kops-stat-store

关于amazon-web-services - kops ssh 公钥权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55419161/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com