×

docker-sshd Docker容器的sshd代理

消耗积分:0 | 格式:zip | 大小:0.00 MB | 2022-05-12

YYXIAO

分享资料个

授权协议 MIT
开发语言 Google Go
操作系统 Linux
软件类型 开源软件
所属分类 云计算Docker 扩展

软件简介

docker-ssh 可以让你直接 ssh 到 docker 容器里边 并且不需要 容器 启动 sshd

+-------------+                                                                 
|             |    ssh CONTAINER1@docker-sshd      +--------------------+       
|     ops     +------------------------------------>                    |       
|             |                                    |    docker-sshd     |       
+-------------+                                    |                    |       
                                                   +----------------+---+       
                                                                    |           
                                                                    |           
                              docker exec -ti CONTAINER1 /bin/bash  |           
                                                                    |           
                +--------------------------------------------------------------+
                |                                                   |          |
                | Docker   +------------+  +------------+    +------v-----+    |
                |          |            |  |            |    |            |    |
                |          | CONTAINER3 |  | CONTAINER2 |    | CONTAINER1 |    |
                |          |            |  |            |    |            |    |
                |          +------------+  +------------+    +------------+    |
                |                                                              |
                +--------------------------------------------------------------+

安装

 

go get github.com/tg123/docker-sshd

 

 

例子

 

  1. 启动一个 叫 CONTAINER1的容器

    docker run -d -t --name CONTAINER1 ubuntu top
    bd78d93154cff5e8b40d19b1676670a49f582d2522384ecfe0d9e7d60846891e
  2. 运行docker-sshd

    $GOPATH/bin/docker-sshd
  3. 使用 CONTAINER1 作为用户名链接 就可以使用了

    ssh CONTAINER1@127.0.0.1 -p 2232
    root@bd78d93154cf:/#

 

 

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !