简体   繁体   English

在 Google Cloud Platform 上设置服务器

[英]Setting up a server on Google Cloud Platform

I spun up a Ubuntu 16.04 VM on Google Cloud Platform and tried following steps one to three on setting the VM up .我在 Google Cloud Platform 上启动了 Ubuntu 16.04 VM,并尝试按照步骤一到三设置 VM

Instead of ssh root@your_server_ip (step one), I just went to the console, clicked on the drop-down under the Connect column in "VM instances" and selected "Open in browser window".而不是ssh root@your_server_ip (第一步),我只是去控制台,单击“VM 实例”中“连接”列下的下拉菜单,然后选择“在浏览器窗口中打开”。 Then I followed steps two and three to create a new user and to give it root privileges.然后我按照第二步和第三步创建一个新用户并赋予它 root 权限。

Skipping the 'recommended' steps 4 and 5, I tried step 6 to do a test log in by activating the Cloud Shell.跳过“推荐”步骤 4 和 5,我尝试通过激活 Cloud Shell 进行第 6 步测试登录。 But ssh [user created in step 2]@your_server_ip , where your_server_ip is the "External IP" in the "VM instances" page results in "Permission denied (publickey)."但是ssh [user created in step 2]@your_server_ip ,其中your_server_ip是“VM 实例”页面中的“外部 IP”,导致“权限被拒绝(公钥)”。

Why is this?为什么是这样?

Martheen comment is right, you need to generate the ssh key pair in order to ssh. Martheen 评论是对的,您需要生成 ssh 密钥对才能生成 ssh。

As you are using the Google Cloud platform I will point you to the documentation related there.当您使用 Google Cloud 平台时,我将向您指出那里的相关文档。 You can use the GCP ways to connect to the instance here .您可以在此处使用 GCP 方式连接到实例。

Other methods to connect you can find here .您可以在此处找到其他连接方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM