• Stars
    star
    159
  • Rank 235,916 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 5 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A pure and slim Golang SSH-Jumper-bastion-web app. One binary rules them all

SSH-Fortress

go version > 1.12 windows10 needs GCC to run with SQLite(CGO) Database

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. Sync your SSHfortress WebApp Account into your linux SSH Account
  5. Manage a server's files by SSH-Fortress's SFTP-web-interface.
  6. 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 be 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. Live 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

More Repositories

1

base64Captcha

captcha of base64 image string
Go
2,102
star
2

felix

A Friendly SSH Jumper Bastion Fortress Server
Go
841
star
3

rdpgo

Go进阶53:从零Go实现Websocket-H5-RDP/VNC远程桌面客户端
Go
233
star
4

ginbro

Converting a MySQL database'schema to a RESTful golang APIs app in the fastest way
Go
115
star
5

chromegin

chromedp-golang 浏览器截图docker 微服务教程
Go
41
star
6

flash

HTTP断点续传多线程下载原理
Go
16
star
7

screen_shot

go+phantomjs网页图片截取微服务
Go
14
star
8

www.mojotv.cn

beego website
HTML
10
star
9

felixfe

Vue
10
star
10

sseread

A tidy library seamlessly reads Server-Sent Events (SSE) from the response body of Go's standard HTTP package.
Go
10
star
11

springboot2app

Springboot2 JPA JWT RESTful APIs boilerplate
Java
9
star
12

recommend-go

用户偏好推荐系统
Go
7
star
13

sshimdemo

Golang开发扩展SSH的使用领域和功能
Go
5
star
14

wordCloudDocker

wordcloud云词docker教程
Python
4
star
15

eslogrushook

博客文章源码: Go进阶45:Golang-logrus简单的日志收集系统(替代ELKB)
Go
4
star
16

blogcode

Go
3
star
17

alg-tea

Go进阶50:简单高效加密算法TEA
Go
2
star
18

httpproxyapp

HTTP-Reverse-Proxy反向代理nginx硬件指纹校验
Go
1
star
19

dueros-bang-game

生活大爆炸-谢尔顿-剪刀石头布-百度智能音箱
PHP
1
star
20

mojocn

1
star
21

util

Go
1
star
22

gptchat

A fullstack chat app, powered by openai GPT, helps you make money - 💰💰💰
TypeScript
1
star
23

wasmdict

the English-Chinese Oxford Dictionary Library, a comprehensive and efficient tool designed to provide seamless dictionary lookup capabilities for both Go and WASM environments.
Go
1
star
24

hillClimbRacing

Hill Climb Racing with different characters. Code by Code Bullet from his website. I just changed colors and assets, and made it touchscreen compatible.
JavaScript
1
star