changeset 1290:ee2ffa044c7e

Add manpage and log for forced_command
author Matt Johnston <matt@ucc.asn.au>
date Tue, 12 Apr 2016 21:05:40 +0800
parents a23386821e9f
children 4a4e5d823cf6
files dropbear.8 svr-runopts.c
diffstat 2 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dropbear.8	Tue Apr 12 21:01:08 2016 +0800
+++ b/dropbear.8	Tue Apr 12 21:05:40 2016 +0800
@@ -91,6 +91,10 @@
 .B \-I \fIidle_timeout
 Disconnect the session if no traffic is transmitted or received for \fIidle_timeout\fR seconds.
 .TP
+.B \-c \fIforced_command
+Disregard the command provided by the user and always run \fIforced_command\fR. This also
+overrides any authorized_keys command= option.
+.TP
 .B \-V
 Print the version
 
@@ -129,6 +133,7 @@
 .TP
 .B command=\fR"\fIforced_command\fR"
 Disregard the command provided by the user and always run \fIforced_command\fR.
+The -c command line option overrides this.
 
 The authorized_keys file and its containing ~/.ssh directory must only be
 writable by the user, otherwise Dropbear will not allow a login using public
--- a/svr-runopts.c	Tue Apr 12 21:01:08 2016 +0800
+++ b/svr-runopts.c	Tue Apr 12 21:05:40 2016 +0800
@@ -351,6 +351,10 @@
 		}
 		opts.idle_timeout_secs = val;
 	}
+
+	if (svr_opts.forced_command) {
+		dropbear_log(LOG_INFO, "Forced command set to '%s'", svr_opts.forced_command);
+	}
 }
 
 static void addportandaddress(const char* spec) {