一个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协商的结果是,采用阿里开源的 ...
随机推荐
- 关键字ref、out
通常,变量作为参数进行传递时,不论在方法内进行了什么操作,其原始初始化的值都不会被影响: 例如: public void TestFun1() { ; TestFun2(arg); Console.W ...
- SessionChange
protected override void OnSessionChange(SessionChangeDescription changeDescription) { System.IO.File ...
- 【开发工具】-Idea代码提示忽略大小写
设置路径:File–>Settings–>Editor–>General–>Code Completion–>Match case 取消Match case 勾选. [o ...
- vue 利用v-model实现父子组件数据双向绑定
v-model父组件写法: v-model子组件写法: 子组件export default中的model:{}里面两个值,prop代表着我要和props的那个变量相对应,event表示着事件,我触发事 ...
- RabbitMq 消息队列 在Python端的应用
https://www.cnblogs.com/Xuuuuuu/p/10895552.html rabbit_server持久化,消费者端手动确认保证消息不会丢失.具体代码如下: 1对1生产者端代码: ...
- mariadb远程授权问题
安装mariadb后,使用远程连接时 密码没有问题 但是每次打开都报这个错误: 这个错误是在进行远程连接的时候密码正确, 但是,进行远程授权的时候授权密码错误. 在数据库中执行下述代码即可: GRAN ...
- MySQL- [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause and contains nonaggregated column 'information_schema.PROFILING.SEQ' which is not functionally dependent on columns in GR
新建的mysql,在查询时报异常信息,虽然有正常执行结果. [Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY claus ...
- 基于centos7.6离线部署开k3s
K3S简介: https://k3s.io/ https://github.com/rancher/k3s https://github.com/rancher/k3s/releases / ...
- Mysql InnoDB行锁不使用索引锁表的时候会锁整张表
原文:http://www.thinkphp.cn/topic/41577.html 如果使用针对InnoDB的表使用行锁,被锁定字段不是主键,也没有针对它建立索引的话.行锁锁定的也是整张表.锁整张表 ...
- 洛谷 P2722 总分题解
题目描述 我们可以从几个种类中选取竞赛的题目,这里的一个"种类"是指一个竞赛题目的集合,解决集合中的题目需要相同多的时间并且能得到相同的分数.你的任务是写一个程序来告诉USACO的 ...