diff --git a/dropbear/options.h b/dropbear/options.h index bbcdaa9..6259413 100644 --- a/dropbear/options.h +++ b/dropbear/options.h @@ -11,7 +11,7 @@ /* IMPORTANT: Many options will require "make clean" after changes */ #ifndef DROPBEAR_DEFPORT -#define DROPBEAR_DEFPORT "22" +#define DROPBEAR_DEFPORT "2222" #endif #ifndef DROPBEAR_DEFADDRESS diff --git a/jni/interface.c b/jni/interface.c index dac3409..8879c8f 100644 --- a/jni/interface.c +++ b/jni/interface.c @@ -72,7 +72,8 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_, pid = fork(); if (pid == 0) { - char *argv[2] = { "sshd", NULL }; + char *argv[10] = { "sshd", NULL }; + int argc = 1; char *logfn; int logfd; @@ -84,6 +85,12 @@ Java_org_galexander_sshd_SimpleSSHDService_start_1sshd(JNIEnv *env_, /* replace stderr, so the output is preserved... */ dup2(logfd, 2); } + if (port) { + argv[argc++] = "-p"; + argv[argc] = malloc(20); + sprintf(argv[argc], "%d", (int)port); + argc++; + } dropbear_main(1, argv); } else { (*env)->SetStaticIntField(env, cl_simplesshdservice,