DropBear ssh server

914 views
Skip to first unread message

Verachten Bruno

unread,
Dec 17, 2013, 5:44:32 AM12/17/13
to andro...@googlegroups.com
Hi,

I'm trying to get a working ssh server on android-x86 (jb).
As the source is already in the tree, I thought of modifying the makefile in order to compile the server side.
Unfortunately, the makefile is overrided at each make, so that my lame attempt doesn't work.

How should I do to compile DropBear as an ssh server?

Kind regards,
Bruno Verachten

Masaki Muranaka

unread,
Dec 17, 2013, 9:12:34 PM12/17/13
to andro...@googlegroups.com
Hello Verachten,

AFAIK, there is no Makefile.mk that is described rules for Dropbear sshd.
I recommend you to build ssh server as NDK application and to install
your Android-x86 system.

It requires some patches to build ssh server. You can google it for
more details. Like this.
http://uriesk.wordpress.com/2013/08/02/crosscompiling-for-android-with-android-ndk/


2013/12/17 Verachten Bruno <goun...@gmail.com>:
> --
> You received this message because you are subscribed to the Google Groups
> "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-x86...@googlegroups.com.
> To post to this group, send email to andro...@googlegroups.com.
> Visit this group at http://groups.google.com/group/android-x86.
> For more options, visit https://groups.google.com/groups/opt_out.



--
--
Masaki Muranaka
Monami-ya LLC, Japan.

Verachten Bruno

unread,
Dec 18, 2013, 11:23:54 AM12/18/13
to android-x86
Hello Masaki,

thanks for the suggestion, I will try that.

Kind regards.
Bruno Verachten

Verachten Bruno

unread,
Jan 9, 2014, 12:22:32 PM1/9/14
to andro...@googlegroups.com
Hi,

I found several "porting" efforts for dropbear on Android. I followed several tutorials, but never get to the end of the compilation.
Did anyone manage to compile dropbear for android-x86?

By the way, is it possible to add the dropbear server to the android-x86 build tree? I would like to get it in the iso, and not have to install it on a running instance.

Kind regards,

Bruno Verachten

Chih-Wei Huang

unread,
Jan 10, 2014, 1:17:27 AM1/10/14
to Android-x86
2014/1/10 Verachten Bruno <goun...@gmail.com>:
The android(-x86) tree already has the openssh,
including the ssh and sshd executables.
Why do you need another one?
You just need to build them to the iso.
(i.e., add them to the packages.mk)


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Verachten Bruno

unread,
Jan 10, 2014, 4:18:53 AM1/10/14
to android-x86
Hi,

> The android(-x86) tree already has the openssh,
> including the ssh and sshd executables.
> Why do you need another one?
> You just need to build them to the iso.
> (i.e., add them to the packages.mk)
I tried to add dropbear server by modifying the makefile already
present, but it got crushed when generating the iso.
I didn't know openssh sshd was already there, my bad.
I'm new to that, so I'll try to understand what to do with that packages.mk.

Thanks a lot,

Bruno Verachten

Verachten Bruno

unread,
Jan 14, 2014, 4:46:52 AM1/14/14
to android-x86
Hi,

I know have an sshd executable in /system/bin.
Thanks a lot.
I still have to figure out how to get it running at boot, and how to
configure it.

Kind regards,
Bruno Verachten
--
Bruno Verachten
AndroidMaison.png

Verachten Bruno

unread,
Jan 17, 2014, 10:43:57 AM1/17/14
to android-x86
Hi,

I modified packages.mk so that it now contains:
PRODUCT_PACKAGES += \
    badblocks \
    e2fsck \
    mke2fs \
    resize2fs \
    tune2fs \
    sshd \
    ssh-keygen \
    sshd_config \
    start-ssh

I launch a new iso build, installed on VirtualBox, and get only a "Error 15" at the boot.
I'll try the build again with a clean beforehands, but I just don't know if this will change anything.

Any hint?

Thanks.

Bruno Verachten

Masaki Muranaka

unread,
Jan 17, 2014, 7:02:49 PM1/17/14
to andro...@googlegroups.com
Hello,

It's not Android-x86 issue but grub's.
You can find some hints via Google. Like this.
http://askubuntu.com/questions/129689/how-do-i-fix-grub-error-15-on-new-dual-boot-install

2014/1/18 Verachten Bruno <goun...@gmail.com>:

Verachten Bruno

unread,
Jan 20, 2014, 6:28:23 AM1/20/14
to android-x86
Hello,

you were right, I remade the iso, reinstalled and didn't have any "Error 15" anymore.
Anyway, even if I have
PRODUCT_PACKAGES += \
    badblocks \
    e2fsck \
    mke2fs \
    resize2fs \
    tune2fs \
    sshd \
    ssh-keygen \
    sshd_config \
    start-ssh \

I still don't have working sshd.
sshd is still complaining that "/data/ssh/sshd_config: No such file or directory".
Was does the     sshd_config \ target do?

Thanks,

Bruno Verachten

Verachten Bruno

unread,
Jan 20, 2014, 11:40:54 AM1/20/14
to android-x86
Hi,

I made some other tests today. So, within adb shell, I got:
/system/bin/ssh-keygen -t dsa -f /data/ssh/ssh_host_dsa_key
Generating public/private dsa key pair.
[...]

Then
/system/bin/ssh-keygen -t rsa -f /data/ssh/ssh_host_rsa_key
Generating public/private rsa key pair.
[...]

Then
/system/bin/sshd -f /etc/ssh/sshd_config
and it seems to work:
netstat
Proto Recv-Q Send-Q Local Address Foreign Address State
[...]
tcp6 0 0 :::22 :::* LISTEN

Unfortunately, I can't logon yet:
ssh ro...@192.168.56.101The authenticity of host '192.168.56.101
(192.168.56.101)' can't be established.
RSA key fingerprint is d6:11:11:12:b7:83:c4:6c:c7:aa:cd:b1:26:e8:bd:30.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.101' (RSA) to the list of known hosts.
Permission denied (publickey,keyboard-interactive).

Any idea?

Thanks,

Bruno Verachten

Verachten Bruno

unread,
Jan 22, 2014, 10:56:06 AM1/22/14
to android-x86
Hi,

with the correct public key, I now can ssh to the running android-x86.
Unfortunately, I still have one problem: I'd like the sshd to start
automatically. For now, I connect to the machine with adb connect/adb
shell, and then launch the start-ssh script.

I've seen it can be done by creating a /data/local/userinit.d file,
but I don't have found yet how to do this when creating the iso file.
I suppose I have to create one somewhere in the source tree, but don't
know where yet.

Any hint?

Verachten Bruno

unread,
Jan 22, 2014, 11:36:10 AM1/22/14
to android-x86
I was wrong with my last idea.
I modified device/generic/x86/init.rc and now have a working ssh server.
I still have to find how to activate passwords, and not keys, but one
step after another.

Thanks a lot!

Bruno Verachten
Reply all
Reply to author
Forward
0 new messages