【问题标题】:using sftp (filezilla) to connect to google cloud instance使用 sftp (filezilla) 连接到谷歌云实例
【发布时间】:2018-02-02 09:55:26
【问题描述】:

到目前为止,我已经能够使用 google cloud sdk 尝试连接到 google cloud 上的 VM 实例,它还在我的 Windows 用户帐户上创建了一个 .ssh 文件夹,同时在线 VM 上创建了一个新用户具有相似名称“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

和设置

包括 ppk 文件

【问题讨论】:

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


    【解决方案1】:

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

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

    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

    【讨论】:

    • 第二页显示编辑>设置>sftp中使用的.ppk文件
    • 将“登录类型”字段设置为“交互式”将使用密码验证。我不确定是否可以从站点管理器添加站点并使用第二个屏幕截图中的编辑-> 首选项-> SSL 中的密钥。如果您使用 Quickconnect bar 连接,将使用 Edit-> Preferences-> SSL 中的键。
    【解决方案2】:

    我遇到了同样的问题。如果您选择“交互式”登录类型,请检查您的 VM 是否允许密码身份验证。在您的服务器上,输入 sudo nano /etc/ssh/sshd_config 并将 passwordAuthentication 字段更改为“yes”,如果它是“no”。

    【讨论】:

      【解决方案3】:

      我这样解决了我的问题。

      首先将您的用户名(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

      【讨论】:

        猜你喜欢
        • 2020-06-23
        • 1970-01-01
        • 2020-04-02
        • 1970-01-01
        • 2020-08-03
        • 1970-01-01
        • 1970-01-01
        • 2021-10-05
        • 2021-02-22
        相关资源
        最近更新 更多