by Devin Yang

建立于: 7年前 ( 更新: 7年前 )

最近刚好开始使用Google的GCE,日志一下Goolge官方的说明文档,如何生成密钥给instance使用。
这里的-C comment会用登录使用者的名称,另外-t使用rsa。
ssh-keygen -t rsa -f ~/.ssh/ccc-gce -C [USERNAME]

再将新建好的密钥放到中继数据中即可罗。


在自己的电脑就可以指定这把密钥进行SSH的公钥验证了。
以下是,示意命令:
ssh -i ~/.ssh/ccc-gcp devin@ccc.tc
Enter passphrase for key '/Users/devin/.ssh/ccc-gcp': 
Welcome to Ubuntu 16.04.3 LTS (GNU/Linux 4.10.0-33-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

49 个包可以更新。
0 个属於安全性更新


*** System restart required ***
Last login: Sat Oct  7 08:43:55 2017 from 61.228.24.27


Google官方完整说明如下:
connecting-to-instance

 

Tags: linux

Devin Yang

文章内容无法一一说明,如果您有什么不了解处,欢印提问哦:)

No Comment

Post your comment

需要登入才可留言!

类似文章


linux

rsync回传的错误码

这里列出所有的rsync错误码,因此在调度中,我们可以了解失败的原因。

linux,cli

如何用date命令,显示昨天的日期

在MacOS或Linux上命令是不同的,但是可以达到相同的效果。 我们来看看如何用date命令显示昨天的日期。

linux

如何在RHEL 7/CentOS7/Fedora变更timezone

在新版的RHEL 7/CentOS 7或Fedora上,我们可以透过timedatectl来查看状态及进行调整。