🎩 simple, fun and transparent SSH (and telnet) bastion server
Find a file
2017-11-13 11:11:41 +01:00
examples/mysql Improve mysql support 2017-11-10 15:41:06 +01:00
vendor Switch to govendor 2017-11-02 10:18:23 +01:00
.dockerignore Improve mysql support 2017-11-10 15:41:06 +01:00
.gitignore Add Makefile 2017-10-31 09:31:36 +01:00
acl.go Add basic ACL support 2017-11-13 10:13:17 +01:00
acl_test.go Add basic ACL support 2017-11-13 10:13:17 +01:00
crypto.go Handle auth by key 2017-11-01 23:42:17 +01:00
db.go Add 'acl {create,inspect,ls,rm}' commands 2017-11-11 00:25:27 +01:00
Dockerfile Add Dockerfile 2017-11-02 10:23:52 +01:00
main.go Add basic ACL support 2017-11-13 10:13:17 +01:00
Makefile Add basic ACL support 2017-11-13 10:13:17 +01:00
proxy.go Handle auth by key 2017-11-01 23:42:17 +01:00
README.md Initial version of README.md 2017-11-13 11:11:41 +01:00
shell.go Add more stats in 'ls' commands 2017-11-11 00:27:52 +01:00
util.go Handle user invites 2017-11-07 19:44:30 +01:00

sshportal

Jump host/Jump server without the jump, a.k.a Transparent SSH bastion

                       ┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
                                  DMZ           │
┌────────┐             │             ┌────────┐
│ homer  │───▶╔═════════════════╗───▶│ host1  │ │
└────────┘    ║                 ║    └────────┘
┌────────┐    ║                 ║    ┌────────┐ │
│  bart  │───▶║    sshportal    ║───▶│ host2  │
└────────┘    ║                 ║    └────────┘ │
┌────────┐    ║                 ║    ┌────────┐
│  lisa  │───▶╚═════════════════╝───▶│ host3  │ │
└────────┘             │             └────────┘
┌────────┐                           ┌────────┐ │
│  ...   │             │             │  ...   │
└────────┘                           └────────┘ │
                       └ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─

Features

  • Host management
  • User management
  • User Group management
  • Host Group management
  • Host Key management
  • User Key management
  • ACL management
  • Connect to host using key or password

Usage

Start the server

$ sshportal
2017/11/13 10:58:35 Admin user created, use the user 'invite:BpLnfgDsc2WD8F2q' to associate a public key with this account
2017/11/13 10:58:35 SSH Server accepting connections on :2222

Link your SSH key with the admin account

$ ssh localhost -p 2222 -l invite:BpLnfgDsc2WD8F2q
Welcome Administrator!

Your key is now associated with the user "admin@sshportal".
Shared connection to localhost closed.
$

Drop an interactive administrator shell

ssh localhost -p 2222 -l admin


    __________ _____           __       __
   / __/ __/ // / _ \___  ____/ /____ _/ /
  _\ \_\ \/ _  / ___/ _ \/ __/ __/ _ '/ /
 /___/___/_//_/_/   \___/_/  \__/\_,_/_/


config>

Create your first host

config> host create bart@foo.example.org
1
config>

List hosts

config> host ls
  ID | NAME |           URL           |   KEY   | PASS | GROUPS | COMMENT
+----+------+-------------------------+---------+------+--------+---------+
   1 | foo  | bart@foo.example.org:22 | default |      |      1 |
Total: 1 hosts.
config>

Get the default key in authorized_keys format

config> key inspect default
[...]
    "PubKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvUP/8FedyIe+a+RWU4KvJ1+iZwtWmY9czJubLwN4RcjKHQMzLqWC7pKZHAABCZjLJjVD/3Zb53jZwbh7mysAkocundMpvUL5+Yb4a8lDiflXkdXT9fZCx+ibJBk4jRnKLGIneSzVtFEerEwQKKnKQoCgPkZwCDaL/jHhDlOmAvxqAJrjiy42HXwppX2UuF8zujs6OKHRYJ/Q1vo0caa6/o1eoyXE9OrOwIk+IcAN3YIQi/B1BOlZOQBzHIZz83AFlD2TcPhyYcbxPyKGih84Zr3rQaaP1WiaiPqxzp3s5OhTLthc5XtCSLzmRSLvgC2eFdNhBDB5KLtO2khBkz5ID",
[...]
config>

Add this key to the server

$ ssh bart@foo.example.org
> umask 077; mkdir -p .ssh; echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvUP/8FedyIe+a+RWU4KvJ1+iZwtWmY9czJubLwN4RcjKHQMzLqWC7pKZHAABCZjLJjVD/3Zb53jZwbh7mysAkocundMpvUL5+Yb4a8lDiflXkdXT9fZCx+ibJBk4jRnKLGIneSzVtFEerEwQKKnKQoCgPkZwCDaL/jHhDlOmAvxqAJrjiy42HXwppX2UuF8zujs6OKHRYJ/Q1vo0caa6/o1eoyXE9OrOwIk+IcAN3YIQi/B1BOlZOQBzHIZz83AFlD2TcPhyYcbxPyKGih84Zr3rQaaP1WiaiPqxzp3s5OhTLthc5XtCSLzmRSLvgC2eFdNhBDB5KLtO2khBkz5ID >> .ssh/authorized_keys

Profit

ssh localhost -p 2222 -l foo
bart@foo>

Install

Get the latest version using GO (recommended way):

go get -u github.com/moul/sshportal