加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – 命令“gcloud compute ssh”和“ssh”之间的区别

发布时间:2020-12-14 01:24:10 所属栏目:Linux 来源:网络整理
导读:gcloud compute ssh comannd与“只是”ssh命令之间究竟有什么区别? 我做了观察,即便如此,我可以使用gcloud compute ssh轻松连接两个实例,我无法使用ssh命令.但是,手动设置ssh-keys后,ssh命令工作正常.但是gcloud命令不应该处理密钥管理吗?如果使用gcloud进
gcloud compute ssh comannd与“只是”ssh命令之间究竟有什么区别?

我做了观察,即便如此,我可以使用gcloud compute ssh轻松连接两个实例,我无法使用ssh命令.但是,手动设置ssh-keys后,ssh命令工作正常.但是gcloud命令不应该处理密钥管理吗?如果使用gcloud进行一次设置,为什么ssh命令无法正常工作

.

工作良好:

gcloud compute ssh instance_2
gcloud compute shh instance_1

.

如果不手动设置ssh-key,则无效:

ssh instance_2
shh instance_1

.

这个问题来自我遇到的另一个问题,这让我疯了几天:OpenMPI: Permission denied error while trying to use mpirun

解决方法

gcloud compute ssh将密钥对安装为?/ .ssh / google_compute_engine [.pub]. ssh默认使用?/ .ssh / identity [.pub].

您可以将Google密钥对复制为默认名称:

$cp ~/.ssh/google_compute_engine ~/.ssh/identity
$cp ~/.ssh/google_compute_engine.pub ~/.ssh/identity.pub

或者您只需指定调用ssh时要使用的私钥:

$ssh -i ~/.ssh/google_compute_engine instance_name

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读