使用sftp(filezilla)连接到谷歌云实例

时间:2018-02-02 09:55:27

标签: ubuntu google-cloud-platform filezilla google-cloud-sdk

到目前为止,我已经能够使用google cloud sdk尝试连接到谷歌云上的虚拟机实例,它还在我的Windows用户帐户上创建了一个.ssh文件夹,同时又创建了一个新用户具有类似名称的在线虚拟机" DIGIVILLE"

这里是filezilla的输出

Status: Waiting to retry...
Status: Connecting to 35.185.21.196...
Response:   fzSftp started
Command:    keyfile "C:\Documents and Settings\DIGIVILLE\.ssh\google_compute_engine.ppk"
Command:    open "root@35.185.21.196" 22
Error:  Disconnected: No supported authentication methods available (server sent: publickey)
Error:  Could not connect to server
Status: Connecting to 35.185.21.196...
Response:   fzSftp started
Command:    keyfile "C:\Documents and Settings\DIGIVILLE\.ssh\google_compute_engine.ppk"
Command:    open "digiville@35.185.21.196" 22
Error:  Disconnected: No supported authentication methods available (server sent: publickey)
Error:  Could not connect to server
Status: Waiting to retry...
Status: Connecting to 35.185.21.196...
Response:   fzSftp started
Command:    keyfile "C:\Documents and Settings\DIGIVILLE\.ssh\google_compute_engine.ppk"
Command:    open "digiville@35.185.21.196" 22
Error:  Disconnected: No supported authentication methods available (server sent: publickey)
Error:  Could not connect to server

和设置

enter image description here

包括ppk文件

enter image description here

3 个答案:

答案 0 :(得分:0)

在第一个屏幕截图中,在“我的网站”中 - >新网站 - >登录类型,您必须选择“密钥文件”。

如果您需要生成密钥文件并将其应用于项目,可以按照此处的说明进行操作:

https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#createsshkeys https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#edit-ssh-metadata

答案 1 :(得分:0)

我有同样的问题。如果您选择“交互式”登录类型,请检查您的VM是否允许passwordAuthentication。在服务器上,键入sudo nano /etc/ssh/sshd_config,如果passwordAuthentication字段为“ no”,则将passwordAuthentication字段更改为“ yes”。

答案 2 :(得分:0)

我这样解决了我的问题。

首先将用户名(在mycase中为sftp用户名)添加到www-data组中,然后将www-data组分配为所有者,最后将权限授予www文件夹。

sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rwX /var/www

请记住重新启动您正在使用的filezilla或任何sftp客户端,以使更改生效。

Permission in google cloud sftp