Bastillion
A modern, web-based SSH console and SSH key management tool.
Bastillion gives you a clean, browser-based way to manage SSH access across all your systems — like a bastion host with a friendly dashboard. It does two things:
-
Web-based SSH terminal — once a host is registered, authorized users can open one or more live terminal sessions to it directly from the browser, with commands optionally broadcast across every open session at once (think tmux's synchronized panes, but for a fleet of remote hosts instead of local panes).
-
SSH key management — Bastillion holds its own SSH keypair and pushes/rotates public keys across the hosts you register, so individual users never need to hold or manage long-lived keys to those systems themselves.
- Log in with 2-factor authentication (Authy or Google Authenticator)
- Manage and distribute SSH public keys, and disable/rotate them centrally
- Launch secure multi-session web shells and share commands across sessions
- Record every session and replay it on demand — audit-ready evidence for any compliance framework
- Group systems into Profiles and control exactly who can reach what
- Save and re-run Composite Scripts across a whole fleet at once
- Stack TLS/SSL over SSH for extra protection

Two live SSH sessions to the existing web and application example hosts.
Contents
- How It Works
- What's New
- Licensing
- Installation Options
- Prerequisites
- Download and Run
- Build from Source
- TLS / HTTPS
- Configuration
- More Screenshots
- License
How It Works
Bastillion sits between your users and the systems they need to reach, acting as a trusted third party rather than a simple password vault. Here's the whole lifecycle, end to end.
1. Bastillion generates its own SSH keypair
On first startup, before anything else, Bastillion generates an Ed25519 keypair for itself — this is the one key that ever gets pushed to your hosts. It's shown in the console output and always visible under Settings.
2. Register a system
An admin adds a host under Manage → Systems (user, host, port, and the path to that
host's authorized_keys file). Bastillion authenticates once with a password or
passphrase you supply, then pushes its own public key into that host's authorized_keys.
From then on it connects using that key — no stored passwords, ever. Status flips to
Success the moment the key is in place.

3. Group systems into Profiles, assign Users
Systems get grouped into named Profiles — think "Production," "Staging," "Database Tier." Users are then linked to profiles under Manage → Users, which is the only thing that controls who can reach what. Revoke a profile assignment and that access is gone immediately, no key rotation needed.

4. Open terminals — and broadcast to all of them at once
Assigned users open Secure Shell → Terminals, pick one or more systems, and get live, resizable, xterm-based terminals in the browser, side by side. Type once, and it goes to every terminal marked active — the same keystroke, the same command, the same output shape, across as many hosts as you selected.

5. Rotate or revoke keys centrally
Because every host trusts the same application key (not one key per user), disabling it once under Manage SSH Keys revokes access everywhere immediately — no need to touch target systems by hand, no hunting down which server has which stale key.

6. Verify the host is who it claims to be
Every connection checks the host key the target system presents against the one Bastillion recorded for it. The first time a host is seen, its key is recorded and trusted; if that key later changes, the connection is refused and the system appears under Manage → Host Keys as changed — blocked, showing the approved fingerprint and the offered one together so you can tell a rebuilt host from an intercepted connection. Trusting the new key is a deliberate, logged act.
This matters more for a bastion than for a laptop. Bastillion hands the target system its private key, and on authentication fallback the password or passphrase you supplied — so anything that can answer on a managed system's address collects credentials for it. Until this check existed, nothing compared that key against anything.
Set hostKeyVerification=strict to also require a manager to approve each newly seen host
before the first connection to it, or off to restore the old behaviour — see
Configuration.
7. Every session is recorded — audit and replay
Everything typed and every byte returned in those terminals is recorded automatically. Managers open Audit Sessions, filter by user or system, and replay any session — side by side for sessions that spanned multiple hosts, with a text filter to jump straight to the lines that matter. Output streams into the page as it loads, so even a session that dumped hundreds of megabytes of logs replays without breaking a sweat.
If you need to show an auditor who ran what, where, and when — this is that evidence,
captured out of the box. Practically every compliance framework has a privileged-access
audit-trail requirement somewhere (PCI DSS, HIPAA, SOC 2, ISO 27001 — pick yours), and
this checks that box without a commercial PAM product. Sessions are kept for 90 days by
default (deleteAuditLogAfter), and recording can be switched off with
ENABLE_INTERNAL_AUDIT=false — see Auditing.

🚀 What's New
- SSH host key verification — the key each managed system presents is recorded on first
sight and checked on every connection after it; a changed key blocks the connection and
surfaces under Manage → Host Keys for a manager to resolve. On by default
(
hostKeyVerification=accept-new) — see How It Works - SSH certificate authentication (optional) — Bastillion can sign a short-lived
certificate per connection instead of relying on its public key being in each host's
authorized_keys, which also puts the Bastillion username in the target host's own auth log. Off by default; needs each host configured to trust the CA — see Configuration - SAML 2.0 SSO — sign in via an enterprise IdP (Entra ID, Okta, ADFS, and others) — see Configuration
- Licensing — free at up to 8 systems, paid tiers available at loophole.company/pricing.html (see Licensing below)
- Session audit & replay, on by default — every terminal session is recorded and can be replayed under Audit Sessions, streamed to the browser so even huge sessions load instantly
- Runs as a self-contained jar (
java -jar) with HTTPS out of the box — see Download and Run - Upgraded to Java 21, Jetty 12, and Jakarta EE 10
- Full support for Ed25519 (default) and Ed448 SSH keys
- v4 migration tool to bring over users, systems, keys, and audit logs from an existing v4 instance — imports straight into 6.x, with no interim 5.x install — see
tools/migrate - Hardened with a CSRF filter and app-wide security headers
Licensing
Bastillion runs unlicensed at up to 8 registered systems — enough to try it for real before buying. A license raises that cap.
- Buy a license at loophole.company/pricing.html
(Starter/Team/Business — priced by system count). Payment redirects back and downloads a
.licfile automatically. - Open the
.licfile and copy its contents (one line). - Set it via the
LICENSE_KEYenvironment variable:
or paste it intoexport LICENSE_KEY=<paste license file contents here>licenseKeyinBastillionConfig.propertiesinstead — the environment variable takes precedence if both are set. - Restart Bastillion. Settings shows the licensee, system cap, and expiry, with a warning starting 90 days before it expires.
Licenses are annual and don't auto-renew — no card kept on file. Buy again from the same pricing page when you get the expiry warning.
Installation Options
Free: https://github.com/Loophole-LLC/Bastillion/releases
Prerequisites
Java 21 (OpenJDK)
apt-get install openjdk-21-jdk
Authenticator (for 2FA)
| Application | Android | iOS |
|---|---|---|
| Authy | Google Play | iTunes |
| Google Authenticator | Google Play | iTunes |
Download and Run
Download the latest jar from Releases:
java -jar bastillion-<version>.jar
Access in browser: https://<server-ip>:8443 — see TLS / HTTPS below for the
self-signed certificate Bastillion generates on first run.
Default credentials:
username: admin
password: changeme
Lock down the default admin account
admin has Full Access (manages users, keys, and terminals on every system), and its
default password is public, so deal with it before adding any systems:
- Change the password right away under Settings → Change Password. Bastillion shows a warning until you do.
- Require two-factor for every local and LDAP login with
oneTimePassword=required(see Configuration), and enrolladminon the next login. - With LDAP or SAML SSO, delete
adminonce a directory user has Full Access. Sign in through the directory, haveadminset that account to Full Access under Manage → Users, then sign in as it and deleteadmin. External logins are mapped to local accounts by username, so a directory or IdP identity namedadminwould sign in as this account; SAML logins also skip two-factor. If you want a local break-glass account, give it a name your directory can never issue, a strong password, and two-factor. SettingexternalAuthLinkBasicAccounts=falsemakes Bastillion refuse an external login that matches any Basic account, so a local account stays local until you switch it to External under Manage → Users. - Limit who can reach the login page. Put Bastillion on a management network or VPN, or behind a reverse proxy that only allows trusted source addresses.
Runs in the foreground; stop with Ctrl+C. For background/daemon operation use whatever your
platform normally uses for a long-running Java process — nohup java -jar ... &, a systemd
unit, a container, etc.
Build from Source
Install Maven 3+:
apt-get install maven
Build and run (packages a self-contained jar with an embedded Jetty server — see
io.bastillion.Main — and runs it):
mvn package
java -jar target/bastillion-6.0.3.jar
Or for local dev without repackaging on every change:
mvn compile exec:java
For an isolated local UI review, keep test data in a separate directory and generate the database password automatically on first startup:
CONFIG_DIR=/tmp/bastillion-ui-review/ TLS_ENABLED=false PORT=8080 \
mvn -DGEN_DB_PASS=true compile exec:java
Open http://localhost:8080 and sign in with the default credentials above. This HTTP
configuration is for local development. For deployment, use HTTPS as described below.
HTML, CSS, and JavaScript are served from target/classes/webapp; after editing files
under src/main/webapp, run mvn resources:resources and reload the browser to see changes. Templates are cached for up to 60 seconds;
restart the development process to clear that cache immediately.
Listens on https://localhost:8443 by default, same as the downloaded release above — see
TLS / HTTPS below for how that certificate gets set up and how to use your
own instead.
TLS / HTTPS
Bastillion generates its own self-signed certificate on first startup and serves HTTPS —
nothing to configure. Browsers will show a warning once (it's self-signed, not issued by a
CA); click through it, same as you would for any other self-hosted appliance. The
certificate and its password persist across restarts (keystore/bastillion.p12 under
CONFIG_DIR, password stored the same encrypted way as the database
password).
Use your own CA-signed certificate instead of the self-signed default — e.g. a free one from Let's Encrypt:
-
Issue the certificate with certbot (requires a real DNS name pointing at this host, and port 80 reachable for the HTTP-01 challenge):
sudo certbot certonly --standalone -d bastillion.example.comThis writes
fullchain.pemandprivkey.pemto/etc/letsencrypt/live/bastillion.example.com/. -
Convert the cert/key pair to PKCS12, the keystore format Bastillion expects:
openssl pkcs12 -export \ -in /etc/letsencrypt/live/bastillion.example.com/fullchain.pem \ -inkey /etc/letsencrypt/live/bastillion.example.com/privkey.pem \ -out bastillion.p12 -name bastillion -passout pass:changeit -
Point Bastillion at it and restart:
export KEYSTORE_PATH=/path/to/bastillion.p12 export KEYSTORE_PASSWORD=changeitBrowsers will now trust the connection with no warning. Let's Encrypt certificates expire every 90 days —
certbot renewfollowed by re-running steps 2–3 (and a restart) keeps it current;certbot renew --deploy-hookcan automate that.
Behind a reverse proxy or load balancer that already terminates TLS (nginx, Cloud Run, etc.) — disable Bastillion's own HTTPS and let it serve plain HTTP instead:
export TLS_ENABLED=false
Defaults to port 8080 in this mode; set PORT to change it.
Configuration
Every setting below can be set as an environment variable — take the property name and
insert an underscore before each capital letter that follows a lowercase letter or digit,
then uppercase it: licenseKey → LICENSE_KEY, dbUser → DB_USER, sshKeyType →
SSH_KEY_TYPE. This is the recommended way to configure Bastillion, especially in
containers — no file to mount or bake in.
Where a property contains a run of capitals, either spelling is accepted: clientIPHeader
can be set as CLIENT_IP_HEADER or CLIENT_IPHEADER, and defaultSSHPassphrase as
DEFAULT_SSH_PASSPHRASE or DEFAULT_SSHPASSPHRASE. Each block below spells out the
variable for every setting, so you shouldn't need to apply the rule by hand.
BastillionConfig.properties still works as a fallback (env vars always win if both are
set), and is where any value Bastillion generates for you at first startup — like a random
DB password — gets persisted. See src/main/resources/BastillionConfig.properties for the
full list of settings and their defaults.
Consolidating everything under one directory (e.g. a single Docker volume mount):
CONFIG_DIR is the one setting to reach for. Everything Bastillion persists —
BastillionConfig.properties, the self-signed TLS keystore (keystore/bastillion.p12), the
H2 database and the SSH host key pair (both under keydb/), and bastillion.jceks — lives
under it by default, so pointing CONFIG_DIR at one place relocates all of it:
export CONFIG_DIR=/data/bastillion/
KEYSTORE_PATH and DB_CONNECTION_URL still exist for pointing just one of those at a
different location on its own (a real cert, a remote DB) — see TLS / HTTPS and
the "Database Settings" section below — but neither is needed just to consolidate everything
into CONFIG_DIR.
CONFIG_DIR itself defaults to ./config relative to the working directory. Upgrading an
existing instance that never set it? Older releases stored state directly in the working
directory instead of ./config — Bastillion detects that on first startup with this version
and moves it into ./config (or into CONFIG_DIR, if you've now set one) automatically.
SSH Key Management
How much of each managed system's authorized_keys file Bastillion takes responsibility for:
# manage (default) - Bastillion owns the file: it is replaced with the public keys of every
# user assigned to that system, plus Bastillion's own. Revoking a user's
# key removes their direct access to the host on the next refresh.
# append - leave the file alone except for making sure Bastillion's own key is in
# it. User keys are not distributed.
# off - never read or write the file at all.
export KEY_MANAGEMENT=manage
# authorized_keys refresh interval in minutes (no refresh for <=0)
export AUTH_KEYS_REFRESH_INTERVAL=120
# Force user key generation and strong passphrases
export FORCE_USER_KEY_GENERATION=false
off is only usable when Bastillion can authenticate some other way — in practice
sshCertificateAuth=on with the authority installed on every host, since otherwise there is
nothing for it to log in with. Bastillion warns loudly at startup if both are off. It also
gives up the fallback: with no application key on the host, a certificate problem locks
Bastillion out of that system instead of degrading to key authentication.
In append and off the refresh timer and the Manage SSH Keys screens are hidden —
there is nothing left for them to distribute.
The older boolean
KEY_MANAGEMENT_ENABLEDstill works and is honoured whenKEY_MANAGEMENTis unset (true→manage,false→append), so an existing instance keeps the behaviour it had. PreferKEY_MANAGEMENTin new setups.
Custom SSH Key Pair
By default Bastillion generates its own Ed25519 keypair on first startup. To use your own instead, the easiest way is through the UI: Settings → Replace Application SSH Key (manager accounts only) — paste in a private key, public key, and passphrase if it has one, and it takes effect immediately, no restart needed.
⚠️ This replaces the *one
