Dropbear can't find USER name in Android

Jan Burg _j at outlook.com
Thu Oct 1 18:05:20 AWST 2015


Hi, I'm using dropbear to make a ssh server on Android. I can generate keys as a root user and connect to the dropbear server as a root user. When I generate keys as a non-root user and start the server, I can't connect using the non-root user's $USER name. I get an "unknown user" error. I took a closer look at the public key extracted from

dropbearkey -y -f ~/.ssh/id_rsa,

and it's missing the username at the bottom. This is what I get from the command above;

Generating key, this may take a while...
Public key portion is:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCmSWZpkTFG0ledIyk3TmeFGK6UwrjvzGyeGKVpt92O9XfBjkWzvrIxucK9sbxfCRCMT0G0RhGsfpRCv80kLjzeL52tW5x3jMWZNAbidVgOZNtQLrogz2lmY6bT3FGN6kh3+1vE1oqa0N59qc4XJC92jdTPkpO9nJRXM9LrFidcyK7tTkGRk5iiFG074nlRn0tysXvs6Zg/8+GhZSz7meI4PMuKbkK2or6wkGJtMDQbJgDn72N2LKzUy7SVRlnFjIxECOoT/30LA1f3pOatztSPaH/XAhEJioyUv6DGbjomlJXrutGcpci16CCtcyP5I7RU916csyASxyuZbnoERc8T @localhost
Fingerprint: md5 77:db:7b:8d:d1:b8:d9:47:dc:5a:fa:0a:0b:ed:3b:02

It just says "@localhost" instead of "u0_a32 at localhost". When I generate keys as root, it determines the "root" username but seems to have problems with usernames. This isn't the first time I've seen this. Pretty much every binary I've compiled for Android has a problem getting the username. Most programs such as busybox can find the user id number ($EUID) though. The only binary I've seen successfully return the username is toolbox. It has a basic "id" applet that prints the username and group names.

I'd like to figure out what the issue is, maybe determine some kind of patch or a workaround.

Here is the source code for Android's toolbox: https://android.googlesource.com/platform/system/core/+/android-5.1.1_r18/toolbox/


Jan 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ucc.gu.uwa.edu.au/pipermail/dropbear/attachments/20151001/f88aedd9/attachment.htm 


More information about the Dropbear mailing list