Dropbear

Dropbear is a lightweight SSH server designed for embedded and resource-limited systems.

What is Dropbear?

Dropbear is a lightweight SSH server that provides SSH functionality with minimal resource consumption, ideal for embedded systems.

Features

Lightweight

  • Small Size: Small size
  • Low Memory: Low memory consumption
  • Fast: Fast
  • Efficient: Efficient

Compatible

  • SSH Protocol: SSH protocol
  • OpenSSH Compatible: OpenSSH compatible
  • Key Formats: Key formats
  • Authentication: Authentication methods

Secure

  • Encryption: Communication encryption
  • Key Exchange: Key exchange
  • Authentication: Secure authentication
  • Session Management: Session management

Installation

Linux

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Install from repository
sudo apt update
sudo apt install dropbear

# Or compile from source
wget https://matt.ucc.asn.au/dropbear/releases/dropbear-2022.83.tar.bz2
tar -xjf dropbear-2022.83.tar.bz2
cd dropbear-2022.83
./configure
make
sudo make install

Configuration

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Configure Dropbear
sudo nano /etc/default/dropbear

# Enable Dropbear
NO_START=0

# Configure port
DROPBEAR_PORT=22

# Configure options
DROPBEAR_EXTRA_ARGS=""

Start Service

1
2
3
4
5
6
# Start service
sudo systemctl start dropbear
sudo systemctl enable dropbear

# Verify status
sudo systemctl status dropbear

Configuration

Configuration File

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# /etc/dropbear/dropbear.conf
# SSH port
Port 22

# Listen address
ListenAddress 0.0.0.0

# Key files
HostKey /etc/dropbear/dropbear_rsa_host_key
HostKey /etc/dropbear/dropbear_dss_host_key

# Authentication options
PasswordAuth on
PubkeyAuth on

SSH Keys

1
2
3
4
5
6
# Generate host keys
sudo dropbearkey -t rsa -f /etc/dropbear/dropbear_rsa_host_key
sudo dropbearkey -t dss -f /etc/dropbear/dropbear_dss_host_key

# Generate user keys
ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa

Use Cases

Embedded Systems

  • IoT: IoT devices
  • Routers: Routers and switches
  • Industrial: Industrial systems
  • Automotive: Automotive systems

Limited Resources

  • VPS: Virtual servers
  • Containers: Containers
  • Cloud: Cloud instances
  • Edge: Edge computing

Development

  • Testing: Test environments
  • Development: Development
  • CI/CD: CI/CD pipelines
  • Automation: Automation

Best Practices

Security

  • Key Authentication: Use key authentication
  • Disable Password: Disable password authentication
  • Firewall: Configure firewall
  • Monitoring: Monitor connections

Configuration

  • Port: Change default port
  • Users: Limit users
  • Access: Control access
  • Logging: Configure logging

Maintenance

  • Updates: Keep updated
  • Keys: Rotate keys
  • Monitoring: Monitor service
  • Backup: Backup configuration

Comparison

vs OpenSSH

FeatureDropbearOpenSSH
SizeSmallLarge
MemoryLowHigh
FeaturesBasicComplete
UseEmbeddedGeneral

vs Others

  • vs PuTTY: Dropbear is server, PuTTY is client
  • vs OpenSSH: Dropbear is lighter
  • vs vsftpd: Different protocols (SSH vs FTP)

References