一个100%Go语言的Web-Term-SSH 堡垒机项目
SSH-Fortress
1. What does it do?
- Make your cluster servers be more safe by expose your SSH connection through SSH-Fortress server
- Login your SSH server through the SSH-Fortress Web Interface and record all input and output history commands.
- Manage your cluster server's SSH Account by SSH-Fortress with Web Account
- Manage a server's files by SSH-Fortress's SFTP-web-interface
- 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-termeg: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.cnhome.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
一个100%Go语言的Web-Term-SSH 堡垒机项目的更多相关文章
- 部署一个基于python语言的web发布环境
---恢复内容开始--- 1) 一门面向对象的语言 2)拥有丰富的库 3)可移植性 4)免费.开源 5)简单易易学 可做软件开发.人工智能.web开发等等 部署流程: Cnetos7.5+Nginx+ ...
- 审计系统---堡垒机项目之strace追踪ssh
strace 追踪ssh的进程ID,记录操作的命令[实际上是内核里面记录的东西],进行操作日志的Py解析达到效果. 修改ssh源码添加访问标志位 源码下载:[本文示例:openssh-7.4p1.ta ...
- 开源web终端ssh解决方案-gateone简介
好久都没来写博客,最近忙啥去了呢? 一是忙于saltstack的二次开发,二是云计算的学习研究中,所以就一直没写东西,今天给大家介绍个工具. 1. 首先来说一下为什么要 web ssh? 许多人不是说 ...
- 基于gSOAP使用头文件的C语言版web service开发过程例子
基于gSOAP使用头文件的C语言版web service开发过程例子 一服务端 1 打开VS2005,创建一个工程,命名为calcServer. 2 添加一个头文件calc.h,编辑内容如下: 1// ...
- gateone安装(web版本ssh)
前言: 好久都没来写博客,最近忙啥去了呢? 一是忙于saltstack的二次开发,二是云计算的学习研究中,所以就一直没写东西,今天给大家介绍个工具. 好了,开始正文! 1.首先来说一下为什么要web ...
- HTTP lab01 做一个简单的测试用 web页面
做一个简单的测试用 web页面 1.安装httpd服务 yum install httpd 安装完httpd服务后,系统就自动生成了/var/www/html目录 创建一个 ...
- Token:共识的下一个100年,区块链技术是无可阻挡的文明进程
Token:共识的下一个100年,区块链技术是无可阻挡的文明进程.很少有人意识到,区块链的应用——Token可能是近100年来最伟大的制度创新,超越股份制,并将是『债券』之后最重要最主流的交易品种,没 ...
- [日常] Go语言圣经-WEB服务与习题
Go语言圣经-web服务 1.Web服务程序,标准库里的方法已经帮我们完成了大量工作 2.main函数将所有发送到/路径下的请求和handler函数关联起来,/开头的请求其实就是所有发送到当前站点上的 ...
- 一个电商项目的Web服务化改造
一个电商项目的Web服务化改造 项目,早期是随便瞎做的,没啥架构,连基本的设计也没. 有需求,实现需求,再反复修改. 大致就是这么做的. 最近,项目要重新架构,和某boss协商的结果是,采用阿里开源的 ...
随机推荐
- mybatis使用foreach处理List中的Map mybatis-----传入传出多个参数,都是map或list,批量更新
https://nannan408.iteye.com/blog/2170470 https://blog.csdn.net/xingzhishen/article/details/86424395 ...
- tf.reduce_max的运用
a=np.array([[[[1],[2],[3]],[[4],[25],[6]]],[[[27],[8],[99]],[[10],[11],[12]]],[[[13],[14],[15]],[[16 ...
- 移动端的touch click事件的理解+点透
移动端在touch上一共有4个事件 touchstart touchmove touchend touchcancel, touchcancel, 一般来说,它们执行的顺序为 touchstart - ...
- js对象的深入理解(六)
一.对象的创建(四种模式)1.工厂模式工厂模式示例: function createPerson(name,age){ var obj = { name:name, age:age, sayName: ...
- js数据类型及变量知识(一)
1.js中基本数据类型有哪些? 基本数据类型: undefined.number.string.boolean.null.[object] object[引用数据类型] ...
- 如何用JS获取地址栏参数的方法
采用正则表达式获取地址栏参数: 写一个方法来进行正则匹配,同样也可以复用 function GetPar(name) { var reg = new RegExp("(^|&)&qu ...
- PHP防止SQL注入攻击和XSS攻击
代码如下: /** * 防SQL注入和XSS攻击 * @param $arr */ function SafeFilter (&$arr) { $ra=Array('/([\x00-\x08, ...
- mouseover和mouseenter两个事件的区别
mouseover(鼠标覆盖) mouseenter(鼠标进入) 二者的本质区别在于,mouseenter不会冒泡,简单的说,它不会被它本身的子元素的状态影响到.但是mouseover就会被它的子元素 ...
- js 高阶函数之柯里化
博客地址:https://ainyi.com/74 定义 在计算机科学中,柯里化(Currying)是把接受多个参数的函数变换成接受一个单一参数(最初函数的第一个参数)的函数,并且返回接受余下的参数且 ...
- xadmin集成DjangoUeditor,以及编辑器的视频路径配置
稍微讲一下DjangoUeditor的配置,因为之前去找配置的时候东拼西凑的,所以自己写一下自己一步步配置的过程.首先我是再github上去下载下来,因为是当作第三方插件集成到xadmin中,所以不用 ...