Tom*_*bec 5 filezilla docker google-cloud-platform docker-container
我在 Google Cloud 虚拟机上运行 docker 容器。我尝试了几个小时从本地计算机上的 filezilla 连接到正在运行的 docker 容器。我已经开始这样的 docker 镜像:
docker run -t -d --name test -p 2222:22 --link postgres7:postgres7 random_image /bin/bash
Run Code Online (Sandbox Code Playgroud)
在我的 filezilla 连接配置中,我设置了:
主机:谷歌云 IP 地址
端口:2222
协议:SFTP
登录类型:普通
用户:root(无密码)
尝试连接时出现此错误:
Status: Connecting to x.x.x.x:2222...
Response: fzSftp started
Command: open "root@x.x.x.x" 2222
Error: Connection refused
Error: Could not connect to server
Run Code Online (Sandbox Code Playgroud)
我已经在谷歌云引擎上打开了端口。
首先,不建议在 docker 容器上安装 ssh 服务器,但我是这样做的:
apt-get install openssh-server
passwd (enter password twice)
PermitRootLogin without-password
到
PermitRootLogin yes
/etc/init.d/ssh restart
现在,您将能够使用您设置的密码以 root 身份连接任何 ftp 客户端到您的 docker 容器。
| 归档时间: |
|
| 查看次数: |
8060 次 |
| 最近记录: |