--- runopts.h
+++ runopts.h
@@ -68,6 +68,10 @@
 
 typedef struct svr_runopts {
 
+#ifdef DROPBEAR_SFTPSERVER
+	char * sftppath;
+#endif
+
 	char * bannerfile;
 
 	int forkbg;
--- svr-chansession.c
+++ svr-chansession.c
@@ -666,7 +666,7 @@
 #if DROPBEAR_SFTPSERVER
 			if ((cmdlen == 4) && strncmp(chansess->cmd, "sftp", 4) == 0) {
 				m_free(chansess->cmd);
-				chansess->cmd = m_strdup(SFTPSERVER_PATH);
+				chansess->cmd = m_strdup(svr_opts.sftppath);
 			} else 
 #endif
 			{
--- svr-runopts.c
+++ svr-runopts.c
@@ -60,6 +60,10 @@
 #if DROPBEAR_DELAY_HOSTKEY
 					"-R		Create hostkeys as required\n" 
 #endif
+#ifdef DROPBEAR_SFTPSERVER
+					"-S sftpserver	Set path to sftp server\n"
+					"		(default: %s)\n"
+#endif
 					"-F		Don't fork into background\n"
 #ifdef DISABLE_SYSLOG
 					"(Syslog support not compiled in, using stderr)\n"
@@ -114,6 +118,9 @@
 #if DROPBEAR_ECDSA
 					ECDSA_PRIV_FILENAME,
 #endif
+#ifdef DROPBEAR_SFTPSERVER
+					SFTPSERVER_PATH,
+#endif
 					MAX_AUTH_TRIES,
 					DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE,
 					DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT);
@@ -133,6 +140,9 @@
 
 
 	/* see printhelp() for options */
+#ifdef DROPBEAR_SFTPSERVER
+	svr_opts.sftppath = NULL;
+#endif
 	svr_opts.bannerfile = NULL;
 	svr_opts.banner = NULL;
 	svr_opts.forced_command = NULL;
@@ -200,6 +210,11 @@
 				case 'R':
 					svr_opts.delay_hostkey = 1;
 					break;
+#ifdef DROPBEAR_SFTPSERVER
+				case 'S':
+					next = &svr_opts.sftppath;
+					break;
+#endif
 				case 'F':
 					svr_opts.forkbg = 0;
 					break;
@@ -331,6 +346,12 @@
 		svr_opts.portcount = 1;
 	}
 
+#ifdef DROPBEAR_SFTPSERVER
+	if (svr_opts.sftppath == NULL) {
+		svr_opts.sftppath = SFTPSERVER_PATH;
+	}
+#endif
+
 	if (svr_opts.bannerfile) {
 		struct stat buf;
 		if (stat(svr_opts.bannerfile, &buf) != 0) {
