Google Compute Engine LAMP 堆栈 SFTP,SQL 和 HTTPS

Google Compute Engine LAMP Stack SFTP,SQL and HTTPS

我已经设置了一个 google 计算 VM,并且可以访问 phpmyadmin 和默认索引页面。当我点击网站上的按钮时,SSH 工作。

我在远程连接到我的服务器实例以进行任何类型的管理时遇到问题(ftp 或 sql)

我关注了这里的防火墙部分:https://cloud.google.com/solutions/mysql-remote-access

但是还是连接不上

我的防火墙配置为:

而且我不知道如何让 HTTPS 正常工作,但是当我将我的网站完全切换到计算引擎时,这可能是一个需要处理的问题。因为我还不能切换我的域或当前的 SSL 证书。

编辑: 更多信息:

当我尝试使用客户端 "Sequel Pro" 连接到 SQL 时 returns:

使用远程登录:

当我尝试连接到 SFTP 时,我得到:

会不会是我密码输入错误造成的?

您的防火墙设置显示您允许外部流量流向 TCP 协议的端口 21 和 3306。这很好,但还不够。

为了允许远程连接到 MySQL,您需要授予对您的用户名和 外部 IP 地址 的远程访问权限。看看 this case for an example. This is also mentioned in step 6 and step 7 of Configure MySQL server on my-server section of the article 你指定的:

mysql> GRANT ALL PRIVILEGES ON *.* TO 'TESTUSER'@'<external-ip-my-client>' IDENTIFIED BY '<some-password>';

关于ftp服务器,虚拟机实例未安装ftp服务,但您可以使用SFTP协议连接到它,这比FTP 协议,强烈推荐。使用 gcloud compute config-ssh 生成 SFTP/SSH 密钥对。欲了解更多信息,请访问 Setting up secure FTP on Google Compute Engine 文章。