mkj / dropbear

Dropbear SSH
https://matt.ucc.asn.au/dropbear/dropbear.html
Other
1.68k stars 399 forks source link

"Non-multiuser Dropbear requires a non-multiuser kernel" error on Android #322

Closed sansjtw1 closed 4 hours ago

sansjtw1 commented 6 hours ago

Title: "Non-multiuser Dropbear requires a non-multiuser kernel" error on Android

Description: I encountered an issue when running Dropbear on an Android device. Even after enabling multi-user support in options.h (#define DROPBEAR_MULTIUSER 1), I still receive the following error during runtime:

Non-multiuser Dropbear requires a non-multiuser kernel

This occurs when I try to start the Dropbear server with the command:

./dropbear -F -r /data/data/com.packag/key/dropbear_rsa_key -p 2223 -s

Steps to Reproduce:

  1. Compile Dropbear on an Android device with #define DROPBEAR_MULTIUSER 1 in options.h.
  2. Start the Dropbear server with the -F and -p options.
  3. Attempt to connect using an SSH client.
  4. Observe the error in the server logs.

Expected Behavior: Dropbear should allow connections when compiled with multi-user support.

Actual Behavior: Dropbear exits with the error message: "Non-multiuser Dropbear requires a non-multiuser kernel."

Environment:

Additional Information: I attempted to recompile Dropbear after enabling multi-user support in options.h but still face the issue. The device has SELinux enabled, and I suspect Android's kernel or SELinux policies might be affecting this problem. Is additional configuration or modification required to run Dropbear on an Android multi-user environment? Any guidance would be appreciated.

Logs:

[11141] Sep 21 05:30:05 Not backgrounding
[11253] Sep 21 05:30:09 Child connection from 127.0.0.1:52470
[11253] Sep 21 05:30:09 Early exit: Non-multiuser Dropbear requires a non-multiuser kernel

Screenshot_2024_0921_060454

sansjtw1 commented 4 hours ago

The issue seems to be resolved, when compiling dropbear use:

make CFLAGS="-DDROPBEAR_SVR_MULTIUSER=1"