Skip to content

Commit e554bc4

Browse files
committed
feat: Implement server CLI interface (bssh-server binary) (#131)
Implement the bssh-server binary with comprehensive CLI interface for managing the SSH server. Features: - Main commands: run, gen-config, hash-password, check-config, gen-host-key, version - Global CLI arguments: -c/--config, -b/--bind-address, -p/--port, -k/--host-key, -v/--verbose, -D/--foreground, --pid-file - Configuration file loading with CLI overrides - Signal handling for graceful shutdown (SIGTERM, SIGINT) - Password hashing with bcrypt (cost factor 12) - SSH host key generation (Ed25519/RSA) - Configuration validation and checking - Proper error handling and exit codes Technical details: - Uses clap for CLI parsing with derive API - Integrates with existing ServerFileConfig from issue #130 - Supports both file-based and CLI-based configuration - Added dependencies: bcrypt 0.16, rand 0.8, ssh-key 0.6 - All clippy checks pass with -D warnings Resolves #131
1 parent 0a42a3e commit e554bc4

4 files changed

Lines changed: 548 additions & 4 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ Thumbs.db
2525
.gemini/
2626
references/
2727
vendor/
28+
bssh-server.yaml

Cargo.lock

Lines changed: 74 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ tokio-util = "0.7.17"
5454
shell-words = "1.1.1"
5555
libc = "0.2"
5656
ipnetwork = "0.20"
57+
bcrypt = "0.16"
58+
rand = "0.8"
59+
ssh-key = { version = "0.6", features = ["std"] }
5760

5861
[target.'cfg(target_os = "macos")'.dependencies]
5962
security-framework = "3.5.1"
@@ -72,3 +75,7 @@ mockall = "0.14"
7275
name = "large_output_benchmark"
7376
harness = false
7477

78+
[[bin]]
79+
name = "bssh-server"
80+
path = "src/bin/bssh_server.rs"
81+

0 commit comments

Comments
 (0)