Skip to content

SSH端口是通的,但连接被拒绝 #28

@songyuyx

Description

@songyuyx

SSH连不上,提示连接被拒绝。 容器运行正常,可以在容器自身终端命令行里正常操作,但无法连接SSH

> C:\>ssh root@192.168.2.121 -p 3299
> Connection closed by 192.168.2.121 port 3299

主机是群晖 docker , docker-compose:

> version: '3.9'  # 使用docker-compose文件版本3.8
> 
> services:
>   tvhelper:
>     build: .  # 构建Dockerfile所在的当前目录
>     image: wukongdaily/box:latest  # 指定构建完成后的镜像名称和标签
>     container_name: wukongdaily
>     network_mode: bridge
>     ports:
>       - "3299:2299"  # 用于ssh
>       - "2280:2280"  # 用于重定向到盒子助手资讯页
>       - "15000:15000"  # 将容器的15000端口映射到宿主机的15000端口,以便通过浏览器dufs文件服务器 上传xapk或者apk 
>     volumes:
>       - /volume1/docker/wukongdaily/data:/data  # 根据需要映射数据卷,此处假设您希望持久化的数据位于./data目录
>     restart: no  # 除非明确要求停止,否则总是重启容器
>     environment:
>       - PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/android-sdk/platform-tools

Ping 端口正常:

> C:\>tcping64 192.168.2.121 3299
> 
> Probing 192.168.2.121:3299/tcp - Port is open - time=0.855ms
> Probing 192.168.2.121:3299/tcp - Port is open - time=0.556ms
> Probing 192.168.2.121:3299/tcp - Port is open - time=0.470ms
> Probing 192.168.2.121:3299/tcp - Port is open - time=1.223ms
> 
> Ping statistics for 192.168.2.121:3299
>      4 probes sent.
>      4 successful, 0 failed.  (0.00% fail)
> Approximate trip times in milli-seconds:
>      Minimum = 0.470ms, Maximum = 1.223ms, Average = 0.776ms
>

容器日志:

> http://172.17.0.11:15000/
> --
> http://127.0.0.1:15000/
> Listening on:
> Wed Mar 4 06:35:36 UTC 2026 容器正在运行中...
> Wed Mar 4 06:35:36 UTC 2026 更多使用指南 请参考:https://wkdaily.cpolar.cn/archives/tvhelper
> Wed Mar 4 06:35:36 UTC 2026 Tips小技巧2: 如果你已经位于容器内的命令行 任意目录下 你都可以输入快捷键t 直达菜单
> Wed Mar 4 06:35:36 UTC 2026 这样可以直接调出菜单
> Wed Mar 4 06:35:36 UTC 2026 你还能在电脑终端执行 docker exec -it tvhelper bash
> Wed Mar 4 06:35:36 UTC 2026 Tips小技巧1: 如果你的容器名称叫tvhelper
> Wed Mar 4 06:35:36 UTC 2026 版本: 1.1.3
> * daemon started successfully
> * daemon not running; starting now at tcp:5037
> Wed Mar 4 06:35:35 UTC 2026 启动 ADB server...
> ...done.
> * Starting OpenBSD Secure Shell server sshd
> Wed Mar 4 06:35:35 UTC 2026 启动 SSH 服务...
> *
> * Starting Apache httpd web server apache2
> Wed Mar 4 06:35:34 UTC 2026 启动 Apache 服务...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions