一个100%Go语言的Web-Term-SSH 堡垒机项目

SSH-Fortress

1. What does it do?

  1. Make your cluster servers be more safe by expose your SSH connection through SSH-Fortress server
  2. Login your SSH server through the SSH-Fortress Web Interface and record all input and output history commands.
  3. Manage your cluster server‘s SSH Account by SSH-Fortress with Web Account
  4. Manage a server‘s files by SSH-Fortress‘s SFTP-web-interface
  5. Easily login into your private Cluster by SSH Proxy provided by SSH-Fortress-Proxy

2. build and run

git clone https://github.com/mojocn/sshfortress.git && cd sshfortress;
go build
echo "run the app with SQLite database"
./sshfortress sqlite -v --listen=‘:3333‘
echo "run the app with Mysql database, you need a config.toml file in your sshfortress binary folder"
./sshfortress run -v --listen=‘:3333‘

Docker pull docker pull mojotvcn/sshfortress

2.1 config.toml

The config.toml file should in sshfortress binary folder. config.toml works with command sshfortress run. Command sshfortress sqlite can run with the config file.

[app]
    name="frotress.mojotv.cn"
    addr=":8360"
    verbose= true
    jwt_expire=240 #hour
    secret="asdf4e8hcjvbkjclkjkklfgki843895iojfdnvufh98" #jwt secret
[db]
    # mysql database connection
    host = "127.0.0.1"
    user = "root"
    dbname = "sshfortress"
    password = "your_mysql_password"
    port = 3306

[github] #github.com OAuth2
    client_id="d0b29360a088d0c4dc18"
    client_secret="89b272eeb22f373d8aa688986a8dbbc4edbfc64a"
    callback_url="http://sshfortress.mojotv.cn/#/"

3. Online demo

https://sshfortress.mojotv.cn/#/login

just click the login button, the default password has input for you, user [email protected] password: admin,

3.1 Universal Web SST Terminal

  • URL : https://sshfortress.mojotv.cn/#/any-term eg: https://sshfortress.mojotv.cn/#/any-term?a=home.mojotv.cn&p=test007&u=test007&z=1
  • URL-ARG a : SSH Address with Port eg: home.mojotv.cn home.mojotv.cn:22
  • URL-ARG u : SSH Username eg: test007
  • URL-ARG p : SSH Password eg: test007
  • URL-ARG z : Not Use Zend Mode eg: 1

4. Run With supervisor & nginx

sshfortress.mojotv.cn.conf

server {
        server_name sshfortress.mojotv.cn;
        charset utf-8;
        location /api/ws-any-term
        {
                proxy_pass http://127.0.0.1:8360;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header X-Real-IP $remote_addr;
         }

        location /api/ws/
        {
                proxy_pass http://127.0.0.1:8360;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header X-Real-IP $remote_addr;
         }
        location / {
           proxy_set_header X-Forwarded-For $remote_addr;
           proxy_set_header Host $http_host;
           proxy_pass http://127.0.0.1:8360;
        }
        access_log  /data/wwwlogs/sshfortress.mojotv.cn.log;

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/sshfortress.mojotv.cn/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/sshfortress.mojotv.cn/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

Supervisor config file: sshfortress.ini

[program:sshfortress.mojotv.cn]
command=/data/sshfortress/bin/sshfortress sqlite
autostart=true
autorestart=true
startsecs=10
user=root
chmod=0777
numprocs=1
redirect_stderr=true
stdout_logfile=/data/sshfortress/supervisor.log

5. Reference

  1. idea from my another repo: libragen/felix
  2. How to run SSH-Terminal in browser
  3. Dockerhub image

原文地址:https://www.cnblogs.com/landv/p/11730149.html

时间: 2024-07-31 12:21:05

一个100%Go语言的Web-Term-SSH 堡垒机项目的相关文章

堡垒机项目实战-web ssh 的使用

linux安装软件一般在usr/local/ 或 /opt/ 原文地址:https://www.cnblogs.com/jintian/p/11349376.html

Web2py是一个用Python语言编写的免费的开源Web框架

Zope 2是一款基于Python的Web应用框架,是所有Python Web应用程序.工具的鼻祖,是Python家族一个强有力的分支.Zope 2的"对象发布"系统非常适合面向对象开发方法,并且可以减轻开发者的学习曲线,还可以帮助你发现应用程序里一些不好的功能. Web2py是一个用Python语言编写的免费的开源Web框架,旨在敏捷快速的开发Web应用,具有快速.可扩展.安全以及可移植的数据库驱动的应用,遵循LGPLv3开源协议. Web2py提供一站式的解决方案,整个开发过程都可

开源web终端ssh解决方案——gateone

1.首先来说一下为什么要web ssh? 有人是说,有xshell,secureRT,putty等众多的ssh终端,为嘛还要弄个web的ssh,不是够二的吗?能起多大作用? 有个web的ssh,的确没有多大作用,的确无法代替ssh客户端,但是你想过没有,类似于xshell,secureRT,putty,在运维管理中确实有很多麻烦,不同的用户,需要不同的登录名,授权等等管理,而且存在一定的风险,比如个人电脑被攻击等等安全问题? 总结: 对于的小型公司如只有50~100来台左右的服务器的话,在实际的

100+ 超全的web开发工具和资源

转载出处:https://xituqu.com/170.html 作为Web开发者,这是好的时代,也是坏的时代.Web开发技术也在不断变化.虽然很令人兴奋,但是这也意味着Web开发人员需要要积极主动的学习新技术和新的编程语言,并愿意和渴望接受新的挑战,以适应变化.新的挑战可能会包括一些开发上的要求,如利用适应现有的框架来满足业务需求.测试一个网站,能从中知道出了哪些技术上的问题,并且我们针对这些问题进行优化和消除.便于后端的开发进程加快和测试.所以我们列出了完整的web开发所需要的工具和资源,助

一个网站的诞生08-- 在Web App嵌入地图

LBS-Location Based Service,基于位置的服务.如果要在Web App嵌入地图,差不多可以做成LBS了.zuijiancanting.com的设计理念,是把Top餐厅放在地图上,那么当你到某个地方逛逛,或者有约会,拖拉一下地图就可以找到合适的餐厅. 提供地图API服务的公司很多,国外有GoogleMap,OpenStreetMap,国内有百度地图,腾讯地图,高德地图.GoogleMap由于某些原因不能正常使用,不在选择之列.我最先考虑的是OpenStreetMap,因为除了

前端的小玩意(9.3)——做一个仿360工具箱的web页面(我的工具里的模板和样式)

前端的小玩意(9.1)--做一个仿360工具箱的web页面(Tab按钮切换) http://blog.csdn.net/qq20004604/article/details/52216203 前端的小玩意(9.2)--做一个仿360工具箱的web页面(全部工具里面的模板) http://blog.csdn.net/qq20004604/article/details/52226223 (三)我的工具页面布局 如图: 首先将其分为二部分: 第一部分是上方整体红色方框区域: 包含若干个独立按钮,按钮

前端的小玩意(9.4)——做一个仿360工具箱的web页面(自动生成所有图标,对图标添加响应逻辑)

前端的小玩意(9.1)--做一个仿360工具箱的web页面(Tab按钮切换) http://blog.csdn.net/qq20004604/article/details/52216203 前端的小玩意(9.2)--做一个仿360工具箱的web页面(全部工具里面的模板) http://blog.csdn.net/qq20004604/article/details/52226223 前端的小玩意(9.3)--做一个仿360工具箱的web页面(我的工具里的模板和样式) http://blog.c

前端的小玩意(9.5)——做一个仿360工具箱的web页面(完结篇,可以跑起来的工具箱)

前端的小玩意(9.1)--做一个仿360工具箱的web页面(Tab按钮切换) http://blog.csdn.net/qq20004604/article/details/52216203 前端的小玩意(9.2)--做一个仿360工具箱的web页面(全部工具里面的模板) http://blog.csdn.net/qq20004604/article/details/52226223 前端的小玩意(9.3)--做一个仿360工具箱的web页面(我的工具里的模板和样式) http://blog.c

一个网站的诞生07-- Tornado Web Server

用Spider抓取数据,然后再做各种处理,然后放到web页面供大家使用. 那么,就需要一个Web Server. 几乎每种语言都有一大堆Web Server开发框架,Python也不例外,比如这里http://www.zhihu.com/question/20706333.廖雪峰同学还有个python的教程http://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac9270762a000/0014023080708