Skip to content

netutils/dropbear: add scp support via SSH exec requests#3586

Open
FelipeMdeO wants to merge 2 commits into
apache:masterfrom
FelipeMdeO:feature/dropbear-add-scp
Open

netutils/dropbear: add scp support via SSH exec requests#3586
FelipeMdeO wants to merge 2 commits into
apache:masterfrom
FelipeMdeO:feature/dropbear-add-scp

Conversation

@FelipeMdeO

Copy link
Copy Markdown
Contributor

Summary

The initial Dropbear port (#) only supports interactive
shell sessions;
This change adds SCP support to the Dropbear server port.

This PR is work continuation of: #3561

Impact

  • No impact when CONFIG_NETUTILS_DROPBEAR_SCP is disabled.
  • When enabled, a new scp builtin is registered and the Dropbear server
    accepts SSH exec requests, which are executed as NSH commands.

Testing

Target: ESP32-C3 (esp32c3-devkit:dropbear, with CONFIG_PIPES=y and
CONFIG_NETUTILS_DROPBEAR_SCP=y).

Copying a file from the host to the board:

$ echo hello > pc.txt
$ scp -O -P 2222 pc.txt root@<board-ip>:/data/pc.txt
    root@<board-ip>'s password:
    pc.txt                                    100%    6     0.1KB/s   00:00

Board side log:

    nsh> ifconfig
    wlan0   Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX at RUNNING mtu 1500
            inet addr:<board-ip> DRaddr:<gateway-ip> Mask:255.255.255.0

    nsh> [7] Jan 01 00:01:24 connection from <host-ip>:34666
    [7] Jan 01 00:01:30 Password auth succeeded for 'root' from <host-ip>:34666
    [7] Jan 01 00:01:30 NSH exec started: scp -t /data/pc.txt
    [8] Jan 01 00:01:30 NSH session exited: 0
    [7] Jan 01 00:01:30 Exit (root) from <<host-ip>:34666>: Disconnect received
    nsh> ls /data
    /data:
     dropbear_ecdsa_host_key
     passwd
     pc.txt

    nsh> cat /data/pc.txt
    hello

Add SCP support do the dropbear server.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
Code Clean up - Remove unnecessary code.

Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
@FelipeMdeO FelipeMdeO force-pushed the feature/dropbear-add-scp branch from 6fffc2f to 6652982 Compare July 4, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant