Wednesday, January 17, 2018

ESP32 SSH Server

I was always wondering whether it is possible to start a SSH server on my little ESP32 board, and I don't want to implement the SSH protocol by myself.

There are several lightweight SSH library out there, however, most of them require POSIX support, which is quite messy to port them to the ESP32.

Upon more research, I found that WolfSSH does not require much POSIX stuff, so I decided to port that to ESP32.

WolfSSH: https://github.com/hopkinskong/wolfssh-esp32
WolfSSL: https://github.com/hopkinskong/wolfssl-esp32

Now, I did not use ESP32 Hardware Crypto Acceleration, only the HW RNG is used for the crypto functions. Also, using PuTTY will unable to connect to the server due to some invalid crypto keys presented to the server.

Proof of concept of SSH<->UART1:
https://github.com/hopkinskong/esp32-ssh-server
Images:
Connection to the ESP32 SSH Server, prompting login:

Logged in, shows my Banana Pi U-Boot command prompt as I have connected the ESP32 UART1 to my Banana Pi Serial Console:

Shows it is my Banana Pi's U-Boot:
Booting Linux, I can now remotely serial debug my Banana Pi:
Note that when using PuTTY, the server will actively close the connection due to some key issues:

No comments:

Post a Comment