从Web端ssh连接到机器或者机器内的容器

栏目: 服务器 · 发布时间: 7年前

内容简介:这个东东能让你使用浏览器连接你远程的机器!下载请先配置好Golang环境,然后

这个东东能让你使用浏览器连接你远程的机器!

一. 环境准备

下载 https://github.com/yudai/gotty

请先配置好Golang环境,然后

go get github.com/yudai/gotty

否则请下载二进制文件

二. ssh到机器

在机器中命令执行

./gotty --port 9090 -c admin:12345 -w bash

打开浏览器 http://127.0.0.1:9090/ ,输入帐号:admin,密码:12345

三. ssh到容器内

新建Dockerfile,在同一目录放入gotty二进制文件

FROM golang:1.8
ADD ./gotty /root/debug/gotty
RUN chmod 755 /root/debug/gotty

build 镜像

docker build -t gotty .

运行该容器,暴露端口,并在容器内执行命令

docker run --rm -it -p 9090:9090 gotty /bin/bash
/root/debug/gotty --port 9090 -c admin:12345 -w bash

以上所述就是小编给大家介绍的《从Web端ssh连接到机器或者机器内的容器》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Advanced Web Metrics with Google Analytics

Advanced Web Metrics with Google Analytics

Brian Clifton / Sybex / 2008 / USD 39.99

Are you getting the most out of your website? Google insider and web metrics expert Brian Clifton reveals the information you need to get a true picture of your site's impact and stay competitive usin......一起来看看 《Advanced Web Metrics with Google Analytics》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

SHA 加密
SHA 加密

SHA 加密工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具