Administration Tools
Stylus SFTP Server provides three administration interfaces with
100% feature parity: a command-line interface (CLI),
a Swing desktop GUI, and a web-based console. All three share the same
AdminEngine backend and support identical operations.
Choose whichever interface fits your workflow — every action
available in one tool is available in the other two.
1. Command-Line Interface (CLI)
The CLI is a scriptable, non-interactive tool for managing the SFTP server from a terminal or from automation scripts. It connects directly to the database — the SFTP server does not need to be running for most commands.
Location
| Platform | Script |
|---|---|
| Windows | bin/admin.bat |
| Linux | bin/admin.sh |
Usage
admin <command> [arguments]
Full Command Reference
The admin tool dispatches on the first positional argument. See
Appendix A — CLI Command Reference
for the complete list, grouped by category. This chapter summarises the
categories only; the appendix carries the exact syntax and description of
every command.
Database
| Command | Description |
|---|---|
init-db |
Initialize or verify the database schema. |
test-connection |
Test database connectivity. |
User Management
| Command | Description |
|---|---|
list-users |
List all SFTP user accounts. |
add-user <user> <pass> |
Create a new user account. |
remove-user <user> |
Delete a user account. |
enable-user <user> |
Enable a disabled account. |
disable-user <user> |
Disable an account (prevents login). |
reset-password <user> <pass> |
Change a user's password. |
set-home-path <user> <path> |
Set a custom home directory for a user. |
verify-home-path <user> |
Check that a user's home directory exists. |
unlock-user <user> |
Clear account lockout (reset consecutive failures). |
Disk Quotas
| Command | Description |
|---|---|
set-quota <user> <bytes> |
Set a per-user disk quota override. |
get-quota <user> |
Show the current quota for a user. |
clear-quota <user> |
Remove the per-user quota override (falls back to default). |
SSH Public Keys
| Command | Description |
|---|---|
add-key <user> <keyfile> |
Add an SSH public key to an account. |
list-keys <user> |
List SSH public keys for a user. |
remove-keys <user> |
Remove all SSH public keys from an account. |
generate-keypair <user> <type> |
Generate an SSH key pair and register the public key. |
Audit & Sessions
| Command | Description |
|---|---|
audit [--limit N] [--user U] |
Query the audit trail. |
sessions |
List active SFTP sessions. |
kill-session <id> |
Disconnect an active session. |
Server Control
| Command | Description |
|---|---|
server-status |
Show server status and version. |
start-server |
Start the SFTP server. |
stop-server |
Stop the SFTP server. |
test-email [--to addr] |
Send a test email notification. |
update-status |
Show whether a newer product version has been published, with the changes since the running version. |
check-update |
Run an update check immediately (recorded in the audit log). See Update Notifications. |
Configuration
| Command | Description |
|---|---|
get-listener-config |
Show listener configuration. |
set-listener-config [args] |
Update listener settings. |
get-security-config |
Show security settings. |
set-security-config [args] |
Update security settings. |
get-filesystem-config |
Show filesystem settings. |
set-filesystem-config [args] |
Update filesystem settings. |
get-timeouts |
Show timeout settings. |
set-timeouts [args] |
Update timeout settings. |
get-notifications |
Show notification configuration. |
set-notifications [args] |
Update notification configuration. |
get-webhooks |
Show webhook configuration. |
get-syslog |
Show syslog configuration. |
set-syslog [args] |
Update syslog configuration. |
Email Addresses
| Command | Description |
|---|---|
get-email <user> |
Show the notification email address for an SFTP user. |
set-email <user> <addr> |
Set the notification email address for an SFTP user. |
get-admin-email <user> |
Show the email address for an admin user. |
set-admin-email <user> <addr> |
Set the email address for an admin user. |
Credentials
| Command | Description |
|---|---|
get-credential <key> |
Read a value from the credential store (credentials.p12). |
set-credential <key> <value> |
Write a value to the credential store (credentials.p12). |
LDAP Groups
| Command | Description |
|---|---|
get-ldap-groups |
Show configured LDAP access and read-only groups. |
set-ldap-groups [args] |
Update LDAP group configuration. |
Portal Configuration
| Command | Description |
|---|---|
get-portal-config |
Show file portal configuration. |
set-portal-config [args] |
Update file portal configuration. |
Certificates
| Command | Description |
|---|---|
list-certs |
List certificates in the keystore. |
import-pem <alias> <cert> <key> |
Import a PEM certificate and private key. |
import-p12 <file> <pass> |
Import a PKCS#12 keystore. |
generate-cert <alias> <cn> |
Generate a self-signed certificate. |
Multi-Factor Authentication
| Command | Description |
|---|---|
mfa-enroll <user> |
Begin MFA enrollment. Returns an otpauth:// URI for the authenticator app and recovery codes. |
mfa-confirm <user> <code> |
Confirm enrollment by verifying a TOTP code from the authenticator app. |
mfa-disable <user> |
Disable MFA for a user (removes the TOTP secret and all recovery codes). |
mfa-status <user> |
Show MFA status: disabled, pending, or enabled. |
mfa-reset <user> |
Disable and re-enroll with a new TOTP secret and fresh recovery codes. |
mfa-admin- prefix (e.g., mfa-admin-enroll,
mfa-admin-status).
Help
| Command | Description |
|---|---|
help |
Show all available commands. |
stop-server and kill-session work by inserting
records into the sftp_commands table, which the server's
CommandPoller picks up.
Authentication
All three administration interfaces require authentication before
granting access. Admin accounts are stored in the
sftp_admin_users database table, which is separate from
the SFTP user accounts in sftp_users. This provides an
independent authentication boundary for administrative access.
Admin accounts are created during installation or via the CLI:
admin create-admin-user <username> --password <password>
Passwords are stored as BCrypt hashes. Admin accounts have an
enabled flag that can be toggled independently.
<admin-required>true</admin-required>,
admin users must also enroll in MFA before they can access the administration tools.
2. Swing GUI (Desktop)
The desktop GUI provides a graphical interface for all administration
tasks. Launch it with bin/admin-gui.bat on Windows.
Login
On launch, the Swing GUI displays a login dialog that requires admin
credentials (username and password from the sftp_admin_users
table). The dialog is modal — the main application window is not
accessible until authentication succeeds. Closing the login dialog
without authenticating exits the application.
Tabs
| Tab | Purpose |
|---|---|
| Server | Real-time server status, version, build number, uptime. Start/stop controls. Shows a dismissible "New version available" notice with the changes since your version when a newer release is published (see Update Notifications). |
| Users | User CRUD: create, enable/disable, reset password, set home path, manage quotas, manage SSH keys. |
| Audit | Audit log viewer with event type filters and failure highlighting (red rows, warning icons). |
| Sessions | Active session list with kill capability. Auto-refreshes every 1–2 seconds. |
| Listeners | Listener configuration: port, address, protocol settings. |
| Database | Database table browser and connection diagnostics. |
| Certificates | Certificate management: list, import PEM/P12, generate self-signed. |
| Security | Security settings: algorithm allow-lists, lockout thresholds, IP filtering. |
| Notifications | Sub-tabs for SMTP, Syslog, and Webhook configuration. Test email button. |
| Settings | Filesystem settings, timeout values, and other runtime parameters. |
| License | Show current activation.key details (edition, customer, expiry, source, SHA-256). Update or clear the license without leaving the admin. |
| Admin Users | CRUD for admin console accounts (separate table from SFTP users): create, disable, reset password, manage per-admin MFA. |
| File Portal | Enable the browser-based File Transfer Portal, set upload caps, max ZIP size, search-result limit, and portal session timeout. |
| Organizations | Three-pane explorer for the identity model: organizations, groups within an org, users in a group, and per-group capability flags. Standard edition and above. |
| Virtual Folders | Register, rename, or repoint virtual folders and grant them to groups with READ / WRITE / READ_WRITE permissions. Mount conflicts are detected on save with a rollback + clear error. |
| Signing | Enterprise-only. Generate or import the operator's PGP signing key that powers Portal Sign and the public /KEYS endpoint. Passphrase is stored in the credential vault. |
3. Web Console
The web-based administration console runs on an embedded Tomcat instance and provides the same capabilities as the CLI and Swing GUI through a browser interface.
Access
| Setting | Default |
|---|---|
| URL | http://localhost:9980/ |
| Configuration | admin-console.xml |
| Authentication | Dedicated admin account (separate from SFTP users) |
Features
- Ext JS frontend with the Triton theme for a modern, responsive interface.
- Dashboard with server status, active sessions, recent audit events, and disk usage overview. When a newer product version is published, a dismissible "New version available" card lists the changes since your version with a download link (see Update Notifications).
- REST API covering user management, audit, sessions, listener & security config, certificates, MFA, license administration, the full identity model (organizations, groups, virtual folders, folder permissions, auth providers), signing, and Portal branding — see Appendix D for the complete list (see Appendix for the full endpoint reference).
- Full parity: user CRUD, audit viewer, session management, certificate management, and all configuration operations.
AI Integration
The AI Integration tab controls whether AI assistants (Claude, GitHub Copilot, Open WebUI, and other Model Context Protocol clients) may connect to the Knowledge Base and read or author its content on a user's behalf. The feature is disabled by default; nothing is exposed until an administrator turns it on.
- Master switch — a single toggle enables or disables
the MCP endpoint for the whole server. While off, the endpoint returns
503 Service Unavailableand no token, however valid, can reach it. - Downloadable client configuration files — instead of
hand-typing connection details, the tab generates a ready-to-use config file
for each supported client:
mcp.jsonfor Claude Code / Claude Desktop (and othermcpServers-style clients);.vscode/mcp.jsonfor Visual Studio Code with GitHub Copilot;- an Open WebUI tool-server import file.
- Token management — the tab lists every active credential (both personal access tokens and OAuth-issued tokens, distinguished by kind) and lets an administrator revoke any of them. See Knowledge Base → Connecting AI Assistants for how tokens are issued, scoped, and authenticated.
The same settings are available from the CLI via
admin get-ai-integration and
admin set-ai-integration, and from the Swing desktop console's
AI Integration panel.
4. License Management
The activation key that governs edition, licensed customer, expiry, and
connection cap can be viewed, replaced, and cleared from every admin
surface. All routes read and write the same activation.key
file in the data directory, so the CLI, Swing GUI, and web console
stay in lockstep.
A server restart is required for a new license to fully take effect. The maximum-connection cap is re-read on the server's hourly renewal timer, but listener gating (FTP/FTPS), LDAP provider selection, external audit sinks, and the storage-backend refusal are boot-time decisions. Every mutation surface prints a clear “restart the server to apply” message so operators know a restart is needed.
Where it lives
| Surface | Path |
|---|---|
| Web Admin | License tab — second tab, immediately after Server |
| Swing Admin | License tab — same position (right after Server) |
| CLI | admin license-status, license-update, license-clear |
| REST | GET / POST / DELETE /api/license |
Updating the license
The Update dialog accepts the license payload in two formats, which are auto-detected on submission:
-
Plain-text — the contents of an
activation.keyfile, header +key=valuelines including thesignature=…line. - Base64 / URL-encoded blob — a single-line encoding of the plain-text form. Both URL-safe and standard base64 alphabets are accepted, with or without padding. MIME line wrapping (76-column) is also tolerated.
After successful validation the file is written atomically. The parser enforces the same rules as boot-time load: signature must verify against the vendor public key, expiry must be in the future, product-version must match. Any failure surfaces as an inline error and nothing is written to disk.
Old-key archival
On every replace and every clear, the existing key is archived under the data directory before removal:
${STYLUS_SFTPSERVER_DATA}/backup_activation_keys/{iso-mtime}-activation.key
The filename encodes the archived file's modification time (colons
replaced with dashes for cross-platform safety) so operators can identify
when each historical key was originally installed. If two archives would
collide on the same mtime, a numeric suffix is appended
(-activation.1.key, -activation.2.key, …).
The admin surface never deletes archived files — they are a
filesystem safety net for manual rollback. To restore a previous key,
copy the archive back to activation.key and restart the
server.
Clearing the license (downgrade to Free)
The Clear action removes activation.key after archiving it.
On next restart the server falls back to Free Edition via the built-in
free-fallback logic. Enterprise features (FTP/FTPS listener, external
audit sinks, LDAP, MFA, quotas, GeoIP, Portal Sign) stop being available
once the restart completes. The Clear dialog and the CLI's
license-clear --confirm flag both surface this consequence
explicitly before proceeding.
Audit trail
Every mutation writes an audit event:
LICENSE_UPDATE— detail carriesold=<edition> new=<edition> customer=<id> expires=<iso>.LICENSE_CLEAR— detail carriesold=<edition>.
The acting admin operator is stamped via the standard executed-by mechanism, so audit rows carry both the change and who made it.
Server Commands via Database
The admin tools do not communicate with the SFTP server over a network
socket. Instead, they write command records to the sftp_commands
database table. The server's CommandPoller polls this table
every 2 seconds and executes pending commands.
This design means the admin tools can run on a completely different machine from the server, as long as both can reach the same database.
Supported Commands
| Command | Effect |
|---|---|
STOP_SERVER |
Gracefully shuts down the SFTP server. |
KILL_SESSION |
Disconnects the specified active session. |
CREATE_USER_HOME |
Creates the home directory for a user account. |
Server Heartbeat
The ServerHeartbeat component updates the
sftp_server_status table every 10 seconds,
allowing admin tools to display up-to-date server information without
a direct connection to the server process.
Tracked Fields
| Field | Description |
|---|---|
state |
Current server state: STARTING, RUNNING,
or STOPPING. |
pid |
Operating system process ID. |
version |
Server version string. |
build_number |
Auto-incrementing build number. |
session_count |
Number of currently active SFTP sessions. |
started_at |
Timestamp when the server started. |
updated_at |
Timestamp of the most recent heartbeat update. |
updated_at timestamp is more than 30 seconds old,
the server is likely not running or has become unresponsive. The admin
tools use this heuristic to display accurate status indicators.