Troubleshooting
Kerberos Authentication Problems
No Valid Kerberos Ticket Found
# Check current ticket status
klist
# Create new forwardable ticket
kinit -f -A
# Verify ticket creation
klist -s
Symptoms:
- Error: “No valid Kerberos ticket found”
- SSH connection fails with authentication error
klistshows no tickets or expired tickets
Solutions:
- Check ticket status:
klist -s - Create new ticket:
kinit -f -A - Verify realm configuration: Check
/etc/krb5.conf - Check DNS resolution: Ensure realm DNS is working
Ticket Expired or Invalid
# Check ticket expiration
klist
# Renew existing ticket
kinit -R
# Create new ticket if renewal fails
kinit -f -A
Symptoms:
- Error: “Ticket expired”
- Authentication fails after some time
klistshows expired tickets
Solutions:
- Automatic renewal:
kinit -R - Manual renewal:
kinit -f -A - Check clock sync: Ensure system time is correct
- Verify KDC: Check KDC server availability
SSH Connection Issues
Connection Refused
# Test basic connectivity
telnet server.company.com 22
# Check SSH service status
ssh -v server.company.com
# Verify firewall rules
sudo iptables -L
Symptoms:
- Error: “Connection refused”
- SSH connection times out
- Port 22 unreachable
Solutions:
- Check SSH service:
systemctl status sshd - Verify port: Ensure SSH is listening on correct port
- Check firewall: Verify firewall allows SSH traffic
- Network connectivity: Test basic network reachability
Authentication Failed
# Test with verbose output
ssh -v user@server.company.com
# Check key permissions
ls -la ~/.ssh/
chmod 600 ~/.ssh/id_rsa
# Test specific key
ssh -i ~/.ssh/id_rsa user@server.company.com
Symptoms:
- Error: “Permission denied”
- Authentication fails with valid credentials
- Key-based authentication fails
Solutions:
- Check key permissions:
chmod 600 ~/.ssh/id_rsa - Verify key format: Ensure key is in correct format
- Check server configuration: Verify
authorized_keyssetup - Test manually: Use standard SSH command to test
Bastion Host Problems
Bastion Connection Fails
# Test bastion connectivity
ssh -t -A -K user@bastion.company.com
# Test with specific port
ssh -p 2222 user@bastion.company.com
# Verify bastion configuration
bayesian-ssh show "Server Name"
# Force direct connection (bypass bastion)
bayesian-ssh connect "Target Server" --no-bastion
# Check if connection is using default bastion
bayesian-ssh show "Target Server"
Symptoms:
- Error: “Bastion connection failed”
- Cannot reach target through bastion
- Bastion authentication fails
Solutions:
- Test bastion directly:
ssh user@bastion.company.com - Check bastion port: Verify correct port (default: 22)
- Verify user permissions: Ensure bastion user has access
- Check network path: Verify bastion is reachable
Target Host Unreachable via Bastion
# Test from bastion to target
ssh -t -A -K user@bastion.company.com "ssh user@target.company.com"
# Check routing on bastion
ssh user@bastion.company.com "route -n"
# Verify target accessibility
ssh user@bastion.company.com "ping target.company.com"
Symptoms:
- Bastion connects but target is unreachable
- Error: “No route to host”
- Connection times out to target
Solutions:
- Check bastion routing: Verify bastion can reach target
- Verify target firewall: Ensure target allows bastion traffic
- Check network segmentation: Verify network policies
- Test manually: Connect to bastion and test target manually
Unexpected Bastion Usage
# Check if connection is using default bastion
bayesian-ssh show "Server Name"
# Force direct connection
bayesian-ssh connect "Server Name" --no-bastion
# Re-add connection with explicit no-bastion flag
bayesian-ssh remove "Server Name"
bayesian-ssh add "Server Name" hostname.com --no-bastion --tags production
Symptoms:
- Connection unexpectedly goes through bastion
- Want direct connection but getting bastion routing
- Default bastion being used when not intended
Solutions:
- Use
--no-bastionflag: Explicitly disable bastion for specific connections - Check connection details: Use
bayesian-ssh showto see bastion configuration - Re-add connection: Remove and re-add with correct bastion settings
- Verify configuration: Check if default bastion is set in config
Database Issues
Database Connection Failed
# Check database file
ls -la ~/.config/bayesian-ssh/
# Verify permissions
chmod 755 ~/.config/bayesian-ssh/
chmod 644 ~/.config/bayesian-ssh/history.db
# Recreate database
rm ~/.config/bayesian-ssh/history.db
bayesian-ssh stats
Symptoms:
- Error: “Database connection failed”
- Cannot save or retrieve connections
- Application crashes on database operations
Solutions:
- Check file permissions: Ensure proper ownership and permissions
- Verify disk space: Check available disk space
- Recreate database: Remove corrupted database file
- Check SQLite version: Ensure compatible SQLite version
Database Schema Issues
# Check database schema
sqlite3 ~/.config/bayesian-ssh/history.db ".schema"
# Verify table structure
sqlite3 ~/.config/bayesian-ssh/history.db "SELECT * FROM connections LIMIT 1;"
Symptoms:
- Error: “Table not found”
- Database operations fail with schema errors
- Missing tables or columns
Solutions:
- Check schema: Verify table structure
- Recreate database: Remove and recreate database
- Check migrations: Ensure schema is up to date
- Verify SQLite: Check SQLite version compatibility
Configuration Problems
Configuration File Not Found
# Check configuration directory
ls -la ~/.config/bayesian-ssh/
# Create default configuration
bayesian-ssh config
# Verify configuration
cat ~/.config/bayesian-ssh/config.json
Symptoms:
- Error: “Configuration file not found”
- Application uses default values
- Configuration changes not saved
Solutions:
- Create directory:
mkdir -p ~/.config/bayesian-ssh/ - Generate config: Run
bayesian-ssh configto create default - Check permissions: Ensure directory is writable
- Verify path: Check configuration file path
Invalid Configuration Values
# View current configuration
bayesian-ssh config
# Reset to defaults
rm ~/.config/bayesian-ssh/config.json
bayesian-ssh config
# Validate configuration
cat ~/.config/bayesian-ssh/config.json | jq .
Symptoms:
- Error: “Invalid configuration”
- Application fails to start
- Configuration values ignored
Solutions:
- Validate JSON: Check JSON syntax
- Reset configuration: Remove and recreate config file
- Check values: Verify configuration parameter values
- Use defaults: Start with minimal configuration
Performance Issues
Slow Connection Establishment
# Check DNS resolution time
time nslookup server.company.com
# Test connection speed
time ssh -o ConnectTimeout=10 user@server.company.com
# Profile application
bayesian-ssh --log-level debug connect "Server Name"
Symptoms:
- Long connection times
- Slow response to commands
- High latency
Solutions:
- Check DNS: Verify DNS resolution speed
- Network latency: Test network performance
- Server load: Check target server performance
- Optimize configuration: Review connection settings
High Memory Usage
# Check memory usage
ps aux | grep bayesian-ssh
# Monitor resource usage
top -p $(pgrep bayesian-ssh)
Symptoms:
- High memory consumption
- Application becomes unresponsive
- System memory pressure
Solutions:
- Check for leaks: Monitor memory usage over time
- Optimize queries: Review database query efficiency
- Limit connections: Reduce concurrent connections
- Update dependencies: Ensure latest library versions
Network and Firewall Issues
Firewall Blocking Connections
# Check local firewall
sudo ufw status
sudo iptables -L
# Test port accessibility
telnet server.company.com 22
nmap -p 22 server.company.com
Symptoms:
- Connection blocked by firewall
- Port 22 unreachable
- Network policy violations
Solutions:
- Check local firewall: Verify local firewall settings
- Corporate policies: Contact network administrator
- Alternative ports: Use non-standard SSH ports
- VPN access: Connect through corporate VPN
DNS Resolution Issues
# Check DNS resolution
nslookup server.company.com
dig server.company.com
# Test with IP address
ssh user@192.168.1.100
# Check /etc/hosts
cat /etc/hosts
Symptoms:
- Hostname not found
- DNS resolution failures
- Connection timeouts
Solutions:
- Check DNS servers: Verify DNS configuration
- Use IP addresses: Connect directly with IP
- Check /etc/hosts: Verify local host entries
- Network configuration: Check network settings
Application Crashes
Panic Errors
# Enable backtrace
RUST_BACKTRACE=1 bayesian-ssh connect "Server"
# Check logs
tail -f ~/.config/bayesian-ssh/bayesian-ssh.log
# Run with verbose output
bayesian-ssh --log-level debug
Symptoms:
- Rust panic errors
- Application terminates unexpectedly
- Error messages with backtraces
Solutions:
- Enable backtraces: Set
RUST_BACKTRACE=1 - Check logs: Review application logs
- Update to latest version: Bug may be fixed in newer release
- Report issue: File a bug report with backtrace on GitHub Issues
Getting Help
Debug Information
When reporting issues, include:
- Error messages: Complete error output
- Environment: OS version, Rust version, dependencies
- Configuration: Relevant configuration files (redact sensitive data)
- Steps to reproduce: Detailed reproduction steps
- Logs: Application and system logs
Useful Diagnostic Commands
# Enable debug logging
bayesian-ssh --log-level debug
# Check system information
uname -a
rustc --version
cargo --version
# Verify dependencies
ldd $(which bayesian-ssh)
# Check file permissions
ls -la ~/.config/bayesian-ssh/
ls -la ~/.ssh/