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 admin@sshfortress.cn 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
 

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

  1. 部署一个基于python语言的web发布环境

    ---恢复内容开始--- 1) 一门面向对象的语言 2)拥有丰富的库 3)可移植性 4)免费.开源 5)简单易易学 可做软件开发.人工智能.web开发等等 部署流程: Cnetos7.5+Nginx+ ...

  2. 审计系统---堡垒机项目之strace追踪ssh

    strace 追踪ssh的进程ID,记录操作的命令[实际上是内核里面记录的东西],进行操作日志的Py解析达到效果. 修改ssh源码添加访问标志位 源码下载:[本文示例:openssh-7.4p1.ta ...

  3. 开源web终端ssh解决方案-gateone简介

    好久都没来写博客,最近忙啥去了呢? 一是忙于saltstack的二次开发,二是云计算的学习研究中,所以就一直没写东西,今天给大家介绍个工具. 1. 首先来说一下为什么要 web ssh? 许多人不是说 ...

  4. 基于gSOAP使用头文件的C语言版web service开发过程例子

    基于gSOAP使用头文件的C语言版web service开发过程例子 一服务端 1 打开VS2005,创建一个工程,命名为calcServer. 2 添加一个头文件calc.h,编辑内容如下: 1// ...

  5. gateone安装(web版本ssh)

    前言: 好久都没来写博客,最近忙啥去了呢? 一是忙于saltstack的二次开发,二是云计算的学习研究中,所以就一直没写东西,今天给大家介绍个工具. 好了,开始正文! 1.首先来说一下为什么要web ...

  6. HTTP lab01 做一个简单的测试用 web页面

      做一个简单的测试用 web页面     1.安装httpd服务   yum install httpd   安装完httpd服务后,系统就自动生成了/var/www/html目录     创建一个 ...

  7. Token:共识的下一个100年,区块链技术是无可阻挡的文明进程

    Token:共识的下一个100年,区块链技术是无可阻挡的文明进程.很少有人意识到,区块链的应用——Token可能是近100年来最伟大的制度创新,超越股份制,并将是『债券』之后最重要最主流的交易品种,没 ...

  8. [日常] Go语言圣经-WEB服务与习题

    Go语言圣经-web服务 1.Web服务程序,标准库里的方法已经帮我们完成了大量工作 2.main函数将所有发送到/路径下的请求和handler函数关联起来,/开头的请求其实就是所有发送到当前站点上的 ...

  9. 一个电商项目的Web服务化改造

    一个电商项目的Web服务化改造 项目,早期是随便瞎做的,没啥架构,连基本的设计也没. 有需求,实现需求,再反复修改. 大致就是这么做的. 最近,项目要重新架构,和某boss协商的结果是,采用阿里开源的 ...

随机推荐

  1. dump net core lldb 分析

    原文https://www.cnblogs.com/calvinK/p/9274239.html centos7 lldb 调试netcore应用的内存泄漏和死循环示例(dump文件调试) 写个dem ...

  2. A Deep Dive Into Draggable and DragTarget in Flutter

    https://medium.com/flutter-community/a-deep-dive-into-draggable-and-dragtarget-in-flutter-487919f6f1 ...

  3. 英语eschaunge交易所

    eschaunge  Eschaunge是一个外文单词,名词译为交易所,交易,交换,兑换(率),动词译为兑换, 交换,互换,交换,调换.是Exchange的替代形式 中文名:交易所,交易,交换 外文 ...

  4. springcloud中gateway的实际应用

    之前我一直用的是Zuul网关,用过gateway以后感觉比Zuul功能还是强大很多. Spring Cloud Gateway是基于Spring5.0,Spring Boot2.0和Project R ...

  5. idea中flink启动报错org.apache.flink.api.common.ExecutionConfig$GlobalJobParameters

    启动时出现如下报错: Caused by: java.lang.ClassNotFoundException: org.apache.flink.api.common.ExecutionConfig$ ...

  6. 产生大于N的Smith数

    实验三  求Smith数 实验目的: 通过本次实验,掌握穷举算法的基本思想. 实验环境: 硬件:PC机 软件:windows操作系统,C语言 实验内容: 若一个合数的质因数分解式逐位相加之和等于其本身 ...

  7. UML——从类图到C++

    简易软件开发流程 实践中,use case and description.class diagram与sequence diagram三者搭配,几乎是UML项目的基本类型,所以在分工或外包的设计文档 ...

  8. Kali和Metasploitable2的网络配置

    Kali和Metasploitable2的网络配置 2017年06月19日 16:00:00 weixin_34275734 阅读数 389   原文链接:https://blog.csdn.net/ ...

  9. The Sum of the k-th Powers(Educational Codeforces Round 7F+拉格朗日插值法)

    题目链接 传送门 题面 题意 给你\(n,k\),要你求\(\sum\limits_{i=1}^{n}i^k\)的值. 思路 根据数学知识或者说题目提示可知\(\sum\limits_{i=1}^{n ...

  10. Hibernate的悲观锁和乐观锁

    前一篇博客我们从数据库角度分析,锁可以分为三种,分别为共享锁,独占锁和更新锁.我们从程序的角度来看锁可以分为两种类型,悲观锁和乐观锁,Hibernate提供对这两种锁 的支持,我们来了解一下Hiber ...