--- localoptions.h
+++ localoptions.h
@@ -27,4 +27,6 @@
 #define MAX_AUTH_TRIES 2     /* limited by freetz, default 10 */
 #define AUTH_TIMEOUT 60      /* limited by freetz down to 60 seconds, default 300 */
 
+#define DEFAULT_PATH "/usr/bin:/bin:/var/bin"
+
 #endif
--- runopts.h
+++ runopts.h
@@ -140,6 +140,7 @@
 
 	int pass_on_env;
 
+	char * childProcessPATH;
 } svr_runopts;
 
 extern svr_runopts svr_opts;
--- svr-chansession.c
+++ svr-chansession.c
@@ -1012,11 +1012,7 @@
 	addnewvar("LOGNAME", ses.authstate.pw_name);
 	addnewvar("HOME", ses.authstate.pw_dir);
 	addnewvar("SHELL", get_user_shell());
-	if (getuid() == 0) {
-		addnewvar("PATH", DEFAULT_ROOT_PATH);
-	} else {
-		addnewvar("PATH", DEFAULT_PATH);
-	}
+	addnewvar("PATH", svr_opts.childProcessPATH);
 	if (cp != NULL) {
 		addnewvar("LANG", cp);
 		m_free(cp);
--- svr-runopts.c
+++ svr-runopts.c
@@ -102,6 +102,8 @@
 					"		(default port is %s if none specified)\n"
 					"-P PidFile	Create pid file PidFile\n"
 					"		(default %s)\n"
+					"-x PATH		Set PATH environment variable of child processes\n"
+					"		(default %s)\n"
 #if INETD_MODE
 					"-i		Start for inetd\n"
 #endif
@@ -134,6 +136,7 @@
 #endif
 					MAX_AUTH_TRIES,
 					DROPBEAR_MAX_PORTS, DROPBEAR_DEFPORT, DROPBEAR_PIDFILE,
+					DEFAULT_PATH,
 					DEFAULT_RECV_WINDOW, DEFAULT_KEEPALIVE, DEFAULT_IDLE_TIMEOUT);
 }
 
@@ -176,6 +179,7 @@
 	svr_opts.hostkey = NULL;
 	svr_opts.delay_hostkey = 0;
 	svr_opts.pidfile = expand_homedir_path(DROPBEAR_PIDFILE);
+	svr_opts.childProcessPATH = NULL;
 #if DROPBEAR_SVR_LOCALTCPFWD
 	svr_opts.nolocaltcp = 0;
 #endif
@@ -276,6 +280,9 @@
 				case 'P':
 					next = &svr_opts.pidfile;
 					break;
+				case 'x':
+					next = &svr_opts.childProcessPATH;
+					break;
 #if DO_MOTD
 				/* motd is displayed by default, -m turns it off */
 				case 'm':
@@ -386,6 +393,10 @@
 	}
 #endif
 
+	if (svr_opts.childProcessPATH == NULL) {
+		svr_opts.childProcessPATH = DEFAULT_PATH;
+	}
+
 	if (svr_opts.bannerfile) {
 		struct stat buf;
 		if (stat(svr_opts.bannerfile, &buf) != 0) {
