Overview
Implement SSH configuration file parsing to support standard OpenSSH config format (~/.ssh/config), enabling bssh to read and apply SSH settings from config files with the -F option.
Technical Approach
Build a custom SSH config parser that:
- Parses standard SSH config format with pattern matching
- Integrates seamlessly with existing bssh configuration
- Maintains precedence (CLI > SSH config > bssh config > defaults)
- Supports wildcards and Include directives
- Incremental implementation starting with core options
Implementation Tasks
Phase 1: Parser Foundation
Phase 2: Core SSH Options
Phase 3: Pattern Matching
Phase 4: Advanced Options
Phase 5: Integration
Priority Options to Support
Priority 1 (Must Have):
- Host, HostName, Port, User
- IdentityFile, StrictHostKeyChecking
- UserKnownHostsFile
Priority 2 (Should Have):
- ProxyJump, ProxyCommand
- ConnectTimeout, ServerAliveInterval
- Compression, PreferredAuthentications
Priority 3 (Nice to Have):
- Match blocks, CanonicalizeHostname
- LocalCommand, SendEnv
Success Criteria
- Parse standard SSH configs without errors
- Correctly resolve host patterns with wildcards
- Apply options with proper precedence
- Parse 1000-line config in < 10ms
- Clear warnings for unsupported options
- Full backward compatibility maintained
Examples
# Use specific SSH config
bssh -F ~/.ssh/config myhost
# Config example that should work:
Host bastion
HostName bastion.example.com
User admin
Port 2222
Host internal-*
ProxyJump bastion
User deploy
IdentityFile ~/.ssh/internal_key
# Usage:
bssh -F ~/.ssh/config internal-server
Labels
enhancement, help wanted, ssh-compat
Overview
Implement SSH configuration file parsing to support standard OpenSSH config format (~/.ssh/config), enabling bssh to read and apply SSH settings from config files with the -F option.
Technical Approach
Build a custom SSH config parser that:
Implementation Tasks
Phase 1: Parser Foundation
src/ssh_config/mod.rs)Phase 2: Core SSH Options
Phase 3: Pattern Matching
Phase 4: Advanced Options
Phase 5: Integration
Priority Options to Support
Priority 1 (Must Have):
Priority 2 (Should Have):
Priority 3 (Nice to Have):
Success Criteria
Examples
Labels
enhancement,help wanted,ssh-compat