Rustion is a lightweight, high-performance SSH bastion/jump host server with a TUI management interface, written in Rust 🦀.
A bastion server (also known as a jump host) is a secure gateway that acts as the single entry point for accessing internal servers. Instead of connecting directly to target machines, users first connect to the bastion, which then forwards their connection to the intended destination. This architecture:
- 🔒 Centralizes access control and auditing
- 🎯 Reduces the attack surface of your infrastructure
- 📋 Provides a single point for monitoring and logging all SSH activity
- 🛡️ Enables fine-grained authorization policies
Rustion implements this concept with modern Rust technologies, offering security, performance, and flexibility.
- Fine-grained Authorization - Control exactly who can access which targets, when, and from where
- SSH Protocol Implementation - Built on
russhcrate for native SSH protocol support (no OpenSSH dependency) - Session Recording - Record SSH sessions in Asciinema v3 format for auditing and replay
- Brute-force Protection - Rate limiting and slow rejection responses to deter attacks
- Connection Pooling - Reuse target connections for improved performance
Rustion implements a custom lightweight Casbin-style RBAC engine using petgraph for role hierarchy management:
- Policy Rules (p) - Define who can do what to which objects
- Role Inheritance (g1) - User-to-role mappings with hierarchical support
- Object Groups (g2) - Organize targets into groups for easier management
- Action Groups (g3) - Group permissions (login, admin, etc.)
Constraint Support:
- Time-of-day restrictions (e.g., allow access only during business hours)
- IP CIDR restrictions (e.g., only from specific networks)
- Expiry dates for temporary access
A full-featured terminal user interface for administration:
- User management (create, update, delete, password reset)
- Target server configuration
- Secret/credential management
- Role and permission assignment
- Policy binding management
- Session recording viewer
# Clone source code
git clone https://github.com/handewo/rustion.git
cd rustion
# Generate an SSH server key
ssh-keygen -t ed25519 -f server_key.pem -N ''
# Initialize Rustion (creates admin user with temporary password)
cargo run -- --init
# Start the server
cargo run
# [2025-11-05T06:54:16Z INFO rustion] Starting Rustion application
# [2025-11-05T06:54:16Z INFO rustion::server::bastion_server] Rustion server started on 127.0.0.1:2222# Connect to the bastion as admin
ssh -p 2222 admin@admin@localhost
# Enter the temporary password from --init
# Reset password when first loginssh -p 2222 user@password@localhost
? New Password:
[Please change your password]# Interactive target selection
ssh -p 2222 user@localhost
# Direct target connection
ssh -p 2222 user@root@target@localhost- Support for additional databases (MySQL, PostgreSQL)
- Integration with external authentication systems (SSO, LDAP, OIDC)
- Support for more target types:
- Kubernetes pods
- MySQL/PostgreSQL/Redis databases
- Custom protocol targets
- SFTP file transfer
- Real-time session monitoring
- AI-assisted anomaly detection
- Web-based administration UI (not planned)
- Acting as a general-purpose SSH server (bastion-focused only)
- Windows server support (Linux/Unix only)
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please:
- Open an issue to discuss significant changes
- Follow the existing code style
- Add tests for new functionality
- Update documentation as needed










