Jan F 003cb0b
diff -up openssh-5.8p1/auth2-pubkey.c.akc openssh-5.8p1/auth2-pubkey.c
Jan F 003cb0b
--- openssh-5.8p1/auth2-pubkey.c.akc	2011-02-10 13:21:27.000000000 +0100
Jan F 003cb0b
+++ openssh-5.8p1/auth2-pubkey.c	2011-02-10 13:21:28.000000000 +0100
7818e56
@@ -27,6 +27,7 @@
7818e56
 
7818e56
 #include <sys/types.h>
7818e56
 #include <sys/stat.h>
7818e56
+#include <sys/wait.h>
7818e56
 
7818e56
 #include <fcntl.h>
7818e56
 #include <pwd.h>
Jan F 003cb0b
@@ -268,27 +269,15 @@ match_principals_file(char *file, struct
7818e56
 
7818e56
 /* return 1 if user allows given key */
7818e56
 static int
7818e56
-user_key_allowed2(struct passwd *pw, Key *key, char *file)
7818e56
+user_search_key_in_file(FILE *f, char *file, Key* key, struct passwd *pw)
7818e56
 {
7818e56
 	char line[SSH_MAX_PUBKEY_BYTES];
7818e56
 	const char *reason;
7818e56
 	int found_key = 0;
7818e56
-	FILE *f;
7818e56
 	u_long linenum = 0;
7818e56
 	Key *found;
7818e56
 	char *fp;
7818e56
 
7818e56
-	/* Temporarily use the user's uid. */
7818e56
-	temporarily_use_uid(pw);
7818e56
-
7818e56
-	debug("trying public key file %s", file);
7818e56
-	f = auth_openkeyfile(file, pw, options.strict_modes);
7818e56
-
7818e56
-	if (!f) {
7818e56
-		restore_uid();
7818e56
-		return 0;
7818e56
-	}
7818e56
-
7818e56
 	found_key = 0;
7818e56
 	found = key_new(key_is_cert(key) ? KEY_UNSPEC : key->type);
7818e56
 
Jan F 003cb0b
@@ -381,8 +370,6 @@ user_key_allowed2(struct passwd *pw, Key
7818e56
 			break;
7818e56
 		}
7818e56
 	}
7818e56
-	restore_uid();
7818e56
-	fclose(f);
7818e56
 	key_free(found);
7818e56
 	if (!found_key)
7818e56
 		debug2("key not found");
Jan F 003cb0b
@@ -444,13 +431,191 @@ user_cert_trusted_ca(struct passwd *pw, 
7818e56
 	return ret;
7818e56
 }
7818e56
 
7818e56
-/* check whether given key is in .ssh/authorized_keys* */
7818e56
+/* return 1 if user allows given key */
7818e56
+static int
7818e56
+user_key_allowed2(struct passwd *pw, Key *key, char *file)
7818e56
+{
7818e56
+	FILE *f;
7818e56
+	int found_key = 0;
7818e56
+
7818e56
+	/* Temporarily use the user's uid. */
7818e56
+	temporarily_use_uid(pw);
7818e56
+
7818e56
+	debug("trying public key file %s", file);
7818e56
+	f = auth_openkeyfile(file, pw, options.strict_modes);
7818e56
+
7818e56
+ 	if (f) {
7818e56
+ 		found_key = user_search_key_in_file (f, file, key, pw);
7818e56
+		fclose(f);
7818e56
+	}
7818e56
+
7818e56
+	restore_uid();
7818e56
+	return found_key;
7818e56
+}
7818e56
+
7818e56
+#ifdef WITH_AUTHORIZED_KEYS_COMMAND
7818e56
+
7818e56
+#define WHITESPACE " \t\r\n"
7818e56
+
7818e56
+/* return 1 if user allows given key */
7818e56
+static int
7818e56
+user_key_via_command_allowed2(struct passwd *pw, Key *key)
7818e56
+{
7818e56
+	FILE *f;
7818e56
+	int found_key = 0;
7818e56
+	char *progname = NULL;
7818e56
+	char *cp;
7818e56
+	struct passwd *runas_pw;
7818e56
+	struct stat st;
7818e56
+	int childdescriptors[2], i;
7818e56
+	pid_t pstat, pid, child;
7818e56
+
7818e56
+	if (options.authorized_keys_command == NULL || options.authorized_keys_command[0] != '/')
7818e56
+		return -1;
7818e56
+
7818e56
+	/* get the run as identity from config */
7818e56
+	runas_pw = (options.authorized_keys_command_runas == NULL)? pw
7818e56
+	    : getpwnam (options.authorized_keys_command_runas);
7818e56
+	if (!runas_pw) {
7818e56
+		error("%s: getpwnam(\"%s\"): %s", __func__,
7818e56
+		    options.authorized_keys_command_runas, strerror(errno));
7818e56
+		return 0;
7818e56
+	}
7818e56
+
7818e56
+	/* Temporarily use the specified uid. */
7818e56
+	if (runas_pw->pw_uid != 0)
7818e56
+		temporarily_use_uid(runas_pw);
7818e56
+
7818e56
+	progname = xstrdup(options.authorized_keys_command);
7818e56
+
7818e56
+	debug3("%s: checking program '%s'", __func__, progname);
7818e56
+
7818e56
+	if (stat (progname, &st) < 0) {
7818e56
+		error("%s: stat(\"%s\"): %s", __func__,
7818e56
+		    progname, strerror(errno));
7818e56
+		goto go_away;
7818e56
+	}
7818e56
+
7818e56
+	if (st.st_uid != 0 || (st.st_mode & 022) != 0) {
7818e56
+		error("bad ownership or modes for AuthorizedKeysCommand \"%s\"",
7818e56
+		    progname);
7818e56
+		goto go_away;
7818e56
+	}
7818e56
+
7818e56
+	if (!S_ISREG(st.st_mode)) {
7818e56
+		error("AuthorizedKeysCommand \"%s\" is not a regular file",
7818e56
+		    progname);
7818e56
+		goto go_away;
7818e56
+	}
7818e56
+
7818e56
+	/*
7818e56
+	 * Descend the path, checking that each component is a
7818e56
+	 * root-owned directory with strict permissions.
7818e56
+	 */
7818e56
+	do {
7818e56
+		if ((cp = strrchr(progname, '/')) == NULL)
7818e56
+			break;
7818e56
+		else 
7818e56
+			*cp = '\0';
7818e56
+	
7818e56
+		debug3("%s: checking component '%s'", __func__, (*progname == '\0' ? "/" : progname));
7818e56
+
7818e56
+		if (stat((*progname == '\0' ? "/" : progname), &st) != 0) {
7818e56
+			error("%s: stat(\"%s\"): %s", __func__,
7818e56
+			    progname, strerror(errno));
7818e56
+			goto go_away;
7818e56
+		}
7818e56
+		if (st.st_uid != 0 || (st.st_mode & 022) != 0) {
7818e56
+			error("bad ownership or modes for AuthorizedKeysCommand path component \"%s\"",
7818e56
+			    progname);
7818e56
+			goto go_away;
7818e56
+		}
7818e56
+		if (!S_ISDIR(st.st_mode)) {
7818e56
+			error("AuthorizedKeysCommand path component \"%s\" is not a directory",
7818e56
+			    progname);
7818e56
+			goto go_away;
7818e56
+		}
7818e56
+	} while (1);
7818e56
+
7818e56
+	/* open the pipe and read the keys */
7818e56
+	if (pipe(childdescriptors)) {
7818e56
+		error("failed to pipe(2) for AuthorizedKeysCommand: %s",
7818e56
+		    strerror(errno));
7818e56
+		goto go_away;
7818e56
+	}
7818e56
+
7818e56
+	child = fork();
7818e56
+	if (child == -1) {
7818e56
+		error("failed to fork(2) for AuthorizedKeysCommand: %s",
7818e56
+		    strerror(errno));
7818e56
+		goto go_away;
7818e56
+	} else if (child == 0) {
7818e56
+		/* we're in the child process here -- we should never return from this block. */
7818e56
+		/* permanently drop privs in child process */
7818e56
+		if (runas_pw->pw_uid != 0) {
7818e56
+			restore_uid();
7818e56
+			permanently_set_uid(runas_pw);
7818e56
+	  	}
7818e56
+
7818e56
+		close(childdescriptors[0]);
7818e56
+		/* put the write end of the pipe on stdout (FD 1) */
7818e56
+		if (dup2(childdescriptors[1], 1) == -1) {
7818e56
+			error("failed to dup2(2) from AuthorizedKeysCommand: %s",
7818e56
+			    strerror(errno));
7818e56
+			_exit(127);
7818e56
+		}
7818e56
+
7818e56
+		debug3("about to execl() AuthorizedKeysCommand: \"%s\" \"%s\"", options.authorized_keys_command, pw->pw_name);
7818e56
+		/* see session.c:child_close_fds() */
7818e56
+		for (i = 3; i < 64; ++i) {
7818e56
+			close(i);
7818e56
+		}
7818e56
+
7818e56
+		execl(options.authorized_keys_command, options.authorized_keys_command, pw->pw_name, NULL);
7818e56
+
7818e56
+		/* if we got here, it didn't work */
7818e56
+		error("failed to execl AuthorizedKeysCommand: %s", strerror(errno)); /* this won't work because we closed the fds above */
7818e56
+		_exit(127);
7818e56
+	}
7818e56
+	
7818e56
+	close(childdescriptors[1]);
7818e56
+	f = fdopen(childdescriptors[0], "r");
7818e56
+	if (!f) {
7818e56
+		error("%s: could not buffer FDs from AuthorizedKeysCommand (\"%s\", \"r\"): %s", __func__,
7818e56
+		    options.authorized_keys_command, strerror (errno));
7818e56
+		goto go_away;
7818e56
+	}
7818e56
+
7818e56
+	found_key = user_search_key_in_file (f, options.authorized_keys_command, key, pw);
7818e56
+	fclose (f);
7818e56
+	do {
7818e56
+		pid = waitpid(child, &pstat, 0);
7818e56
+	} while (pid == -1 && errno == EINTR);
7818e56
+
7818e56
+	/* what about the return value from the child process? */
7818e56
+go_away:
7818e56
+	if (progname)
7818e56
+		xfree (progname);
7818e56
+
7818e56
+	if (runas_pw->pw_uid != 0)
7818e56
+		restore_uid();
7818e56
+	return found_key;
7818e56
+}
7818e56
+#endif
7818e56
+
7818e56
+/* check whether given key is in 
7818e56
 int
7818e56
 user_key_allowed(struct passwd *pw, Key *key)
7818e56
 {
7818e56
 	int success;
7818e56
 	char *file;
7818e56
 
7818e56
+#ifdef WITH_AUTHORIZED_KEYS_COMMAND
7818e56
+	success = user_key_via_command_allowed2(pw, key);
7818e56
+	if (success > 0)
7818e56
+		return success;
7818e56
+#endif
7818e56
+
7818e56
 	if (auth_key_is_revoked(key))
7818e56
 		return 0;
7818e56
 	if (key_is_cert(key) && auth_key_is_revoked(key->cert->signature_key))
Jan F 003cb0b
diff -up openssh-5.8p1/configure.ac.akc openssh-5.8p1/configure.ac
Jan F 003cb0b
--- openssh-5.8p1/configure.ac.akc	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
+++ openssh-5.8p1/configure.ac	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
@@ -1422,6 +1422,18 @@ AC_ARG_WITH(audit,
7818e56
 	esac ]
7818e56
 )
7818e56
 
7818e56
+# Check whether user wants AuthorizedKeysCommand support
7818e56
+AKC_MSG="no"
7818e56
+AC_ARG_WITH(authorized-keys-command,
7818e56
+	[  --with-authorized-keys-command      Enable AuthorizedKeysCommand support],
7818e56
+	[
7818e56
+		if test "x$withval" != "xno" ; then
7818e56
+			AC_DEFINE([WITH_AUTHORIZED_KEYS_COMMAND], 1, [Enable AuthorizedKeysCommand support])
7818e56
+			AKC_MSG="yes"
7818e56
+		fi
7818e56
+	]
7818e56
+)
7818e56
+
7818e56
 dnl    Checks for library functions. Please keep in alphabetical order
7818e56
 AC_CHECK_FUNCS( \
7818e56
 	arc4random \
Jan F 003cb0b
@@ -4325,6 +4337,7 @@ echo "                   SELinux support
7818e56
 echo "                 Smartcard support: $SCARD_MSG"
7818e56
 echo "                     S/KEY support: $SKEY_MSG"
7818e56
 echo "              TCP Wrappers support: $TCPW_MSG"
7818e56
+echo "     AuthorizedKeysCommand support: $AKC_MSG"
7818e56
 echo "              MD5 password support: $MD5_MSG"
7818e56
 echo "                   libedit support: $LIBEDIT_MSG"
7818e56
 echo "  Solaris process contract support: $SPC_MSG"
Jan F 003cb0b
diff -up openssh-5.8p1/servconf.c.akc openssh-5.8p1/servconf.c
Jan F 003cb0b
--- openssh-5.8p1/servconf.c.akc	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
+++ openssh-5.8p1/servconf.c	2011-02-10 13:28:21.000000000 +0100
Jan F 003cb0b
@@ -134,6 +134,8 @@ initialize_server_options(ServerOptions 
7818e56
 	options->num_permitted_opens = -1;
7818e56
 	options->adm_forced_command = NULL;
7818e56
 	options->chroot_directory = NULL;
7818e56
+	options->authorized_keys_command = NULL;
7818e56
+	options->authorized_keys_command_runas = NULL;
7818e56
 	options->zero_knowledge_password_authentication = -1;
7818e56
 	options->revoked_keys_file = NULL;
7818e56
 	options->trusted_user_ca_keys = NULL;
Jan F 003cb0b
@@ -331,6 +333,7 @@ typedef enum {
7818e56
 	sZeroKnowledgePasswordAuthentication, sHostCertificate,
Jan F. Chadima 1b8a267
 	sRevokedKeys, sTrustedUserCAKeys, sAuthorizedPrincipalsFile,
Jan F 003cb0b
 	sKexAlgorithms, sIPQoS,
7818e56
+	sAuthorizedKeysCommand, sAuthorizedKeysCommandRunAs,
7818e56
 	sDeprecated, sUnsupported
7818e56
 } ServerOpCodes;
7818e56
 
Jan F 003cb0b
@@ -456,6 +459,13 @@ static struct {
Jan F. Chadima 1b8a267
 	{ "authorizedprincipalsfile", sAuthorizedPrincipalsFile, SSHCFG_ALL },
Jan F 003cb0b
 	{ "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL },
Jan F 003cb0b
 	{ "ipqos", sIPQoS, SSHCFG_ALL },
7818e56
+#ifdef WITH_AUTHORIZED_KEYS_COMMAND
7818e56
+	{ "authorizedkeyscommand", sAuthorizedKeysCommand, SSHCFG_ALL },
7818e56
+	{ "authorizedkeyscommandrunas", sAuthorizedKeysCommandRunAs, SSHCFG_ALL },
7818e56
+#else
7818e56
+	{ "authorizedkeyscommand", sUnsupported, SSHCFG_ALL },
7818e56
+	{ "authorizedkeyscommandrunas", sUnsupported, SSHCFG_ALL },
7818e56
+#endif
7818e56
 	{ NULL, sBadOption, 0 }
7818e56
 };
7818e56
 
Jan F 003cb0b
@@ -1406,6 +1416,20 @@ process_server_config_line(ServerOptions
Jan F 003cb0b
 		}
Jan F 003cb0b
 		break;
7818e56
 
7818e56
+	case sAuthorizedKeysCommand:
7818e56
+		len = strspn(cp, WHITESPACE);
7818e56
+		if (*activep && options->authorized_keys_command == NULL)
7818e56
+			options->authorized_keys_command = xstrdup(cp + len);
7818e56
+		return 0;
7818e56
+
7818e56
+	case sAuthorizedKeysCommandRunAs:
7818e56
+		charptr = &options->authorized_keys_command_runas;
7818e56
+
7818e56
+		arg = strdelim(&cp;;
7818e56
+		if (*activep && *charptr == NULL)
7818e56
+			*charptr = xstrdup(arg);
7818e56
+		break;
7818e56
+
7818e56
 	case sDeprecated:
7818e56
 		logit("%s line %d: Deprecated option %s",
7818e56
 		    filename, linenum, arg);
Jan F 003cb0b
@@ -1499,6 +1523,8 @@ copy_set_server_options(ServerOptions *d
7818e56
 	M_CP_INTOPT(gss_authentication);
7818e56
 	M_CP_INTOPT(rsa_authentication);
7818e56
 	M_CP_INTOPT(pubkey_authentication);
7818e56
+	M_CP_STROPT(authorized_keys_command);
7818e56
+	M_CP_STROPT(authorized_keys_command_runas);
7818e56
 	M_CP_INTOPT(kerberos_authentication);
7818e56
 	M_CP_INTOPT(hostbased_authentication);
Jan F. Chadima 1b8a267
 	M_CP_INTOPT(hostbased_uses_name_from_packet_only);
Jan F 003cb0b
@@ -1753,6 +1779,8 @@ dump_config(ServerOptions *o)
7818e56
 	dump_cfg_string(sRevokedKeys, o->revoked_keys_file);
Jan F. Chadima 1b8a267
 	dump_cfg_string(sAuthorizedPrincipalsFile,
Jan F. Chadima 1b8a267
 	    o->authorized_principals_file);
7818e56
+	dump_cfg_string(sAuthorizedKeysCommand, o->authorized_keys_command);
7818e56
+	dump_cfg_string(sAuthorizedKeysCommandRunAs, o->authorized_keys_command_runas);
7818e56
 
7818e56
 	/* string arguments requiring a lookup */
7818e56
 	dump_cfg_string(sLogLevel, log_level_name(o->log_level));
Jan F 003cb0b
diff -up openssh-5.8p1/servconf.h.akc openssh-5.8p1/servconf.h
Jan F 003cb0b
--- openssh-5.8p1/servconf.h.akc	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
+++ openssh-5.8p1/servconf.h	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
@@ -161,6 +161,8 @@ typedef struct {
7818e56
 	char   *revoked_keys_file;
7818e56
 	char   *trusted_user_ca_keys;
Jan F. Chadima 1b8a267
 	char   *authorized_principals_file;
7818e56
+	char   *authorized_keys_command;
7818e56
+	char   *authorized_keys_command_runas;
7818e56
 }       ServerOptions;
7818e56
 
7818e56
 void	 initialize_server_options(ServerOptions *);
Jan F 003cb0b
diff -up openssh-5.8p1/sshd_config.0.akc openssh-5.8p1/sshd_config.0
Jan F 003cb0b
--- openssh-5.8p1/sshd_config.0.akc	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
+++ openssh-5.8p1/sshd_config.0	2011-02-10 13:21:28.000000000 +0100
Jan F. Chadima c6801b9
@@ -71,6 +71,23 @@ DESCRIPTION
7818e56
 
Jan F. Chadima c6801b9
              See PATTERNS in ssh_config(5) for more information on patterns.
7818e56
 
7818e56
+     AuthorizedKeysCommand
7818e56
+
7818e56
+             Specifies a program to be used for lookup of the user's
Jan F. Chadima c6801b9
+	     public keys.  The program will be invoked with its first
Jan F. Chadima c6801b9
+	     argument the name of the user being authorized, and should produce 
Jan F. Chadima c6801b9
+	     on standard output AuthorizedKeys lines (see AUTHORIZED_KEYS 
Jan F. Chadima c6801b9
+	     in sshd(8)).  By default (or when set to the empty string) there is no
Jan F. Chadima c6801b9
+	     AuthorizedKeysCommand run.  If the AuthorizedKeysCommand does not successfully
Jan F. Chadima c6801b9
+	     authorize the user, authorization falls through to the
Jan F. Chadima c6801b9
+	     AuthorizedKeysFile.  Note that this option has an effect
Jan F. Chadima c6801b9
+	     only with PubkeyAuthentication turned on.
7818e56
+
7818e56
+     AuthorizedKeysCommandRunAs
7818e56
+             Specifies the user under whose account the AuthorizedKeysCommand is run.
7818e56
+             Empty string (the default value) means the user being authorized
7818e56
+             is used.
7818e56
+
Jan F. Chadima c6801b9
      AuthorizedKeysFile
Jan F. Chadima c6801b9
              Specifies the file that contains the public keys that can be used
Jan F. Chadima c6801b9
              for user authentication.  The format is described in the
Jan F 003cb0b
@@ -398,7 +415,8 @@ DESCRIPTION
Jan F. Chadima c6801b9
 
Jan F. Chadima c6801b9
              Only a subset of keywords may be used on the lines following a
Jan F. Chadima c6801b9
              Match keyword.  Available keywords are AllowAgentForwarding,
Jan F. Chadima c6801b9
-             AllowTcpForwarding, AuthorizedKeysFile, AuthorizedPrincipalsFile,
Jan F. Chadima c6801b9
+             AllowTcpForwarding, AuthorizedKeysFile, AuthorizedKeysCommand,
Jan F. Chadima c6801b9
+             AuthorizedKeysCommandRunAs, AuthorizedPrincipalsFile,
Jan F. Chadima c6801b9
              Banner, ChrootDirectory, ForceCommand, GatewayPorts,
Jan F. Chadima c6801b9
              GSSAPIAuthentication, HostbasedAuthentication,
Jan F. Chadima c6801b9
              HostbasedUsesNameFromPacketOnly, KbdInteractiveAuthentication,
Jan F 003cb0b
diff -up openssh-5.8p1/sshd_config.5.akc openssh-5.8p1/sshd_config.5
Jan F 003cb0b
--- openssh-5.8p1/sshd_config.5.akc	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
+++ openssh-5.8p1/sshd_config.5	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
@@ -703,6 +703,8 @@ Available keywords are
Jan F. Chadima 1b8a267
 .Cm AllowAgentForwarding ,
Jan F. Chadima 1b8a267
 .Cm AllowTcpForwarding ,
Jan F. Chadima 1b8a267
 .Cm AuthorizedKeysFile ,
Jan F. Chadima 1b8a267
+.Cm AuthorizedKeysCommand ,
Jan F. Chadima 1b8a267
+.Cm AuthorizedKeysCommandRunAs ,
Jan F. Chadima 1b8a267
 .Cm AuthorizedPrincipalsFile ,
Jan F. Chadima 1b8a267
 .Cm Banner ,
Jan F. Chadima 1b8a267
 .Cm ChrootDirectory ,
Jan F 003cb0b
@@ -715,6 +717,7 @@ Available keywords are
7818e56
 .Cm KerberosAuthentication ,
7818e56
 .Cm MaxAuthTries ,
7818e56
 .Cm MaxSessions ,
7818e56
+.Cm PubkeyAuthentication ,
7818e56
 .Cm PasswordAuthentication ,
7818e56
 .Cm PermitEmptyPasswords ,
7818e56
 .Cm PermitOpen ,
Jan F 003cb0b
@@ -917,6 +920,20 @@ Specifies a list of revoked public keys.
7818e56
 Keys listed in this file will be refused for public key authentication.
7818e56
 Note that if this file is not readable, then public key authentication will
7818e56
 be refused for all users.
7818e56
+.It Cm AuthorizedKeysCommand
7818e56
+Specifies a program to be used for lookup of the user's
7818e56
+public keys.  The program will be invoked with its first
7818e56
+argument the name of the user being authorized, and should produce 
7818e56
+on standard output AuthorizedKeys lines (see AUTHORIZED_KEYS 
7818e56
+in sshd(8)).  By default (or when set to the empty string) there is no
7818e56
+AuthorizedKeysCommand run.  If the AuthorizedKeysCommand does not successfully
7818e56
+authorize the user, authorization falls through to the
7818e56
+AuthorizedKeysFile.  Note that this option has an effect
7818e56
+only with PubkeyAuthentication turned on.
7818e56
+.It Cm AuthorizedKeysCommandRunAs
7818e56
+Specifies the user under whose account the AuthorizedKeysCommand is run. Empty
7818e56
+string (the default value) means the user being authorized is used.
7818e56
+.Dq 
7818e56
 .It Cm RhostsRSAAuthentication
7818e56
 Specifies whether rhosts or /etc/hosts.equiv authentication together
7818e56
 with successful RSA host authentication is allowed.
Jan F 003cb0b
diff -up openssh-5.8p1/sshd_config.akc openssh-5.8p1/sshd_config
Jan F 003cb0b
--- openssh-5.8p1/sshd_config.akc	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
+++ openssh-5.8p1/sshd_config	2011-02-10 13:21:28.000000000 +0100
Jan F 003cb0b
@@ -46,6 +46,8 @@ SyslogFacility AUTHPRIV
Jan F. Chadima 1b8a267
 #RSAAuthentication yes
Jan F. Chadima 1b8a267
 #PubkeyAuthentication yes
Jan F. Chadima 1b8a267
 #AuthorizedKeysFile	.ssh/authorized_keys
Jan F. Chadima 1b8a267
+#AuthorizedKeysCommand none
Jan F. Chadima 1b8a267
+#AuthorizedKeysCommandRunAs nobody
Jan F. Chadima 1b8a267
 
Jan F. Chadima 1b8a267
 # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
Jan F. Chadima 1b8a267
 #RhostsRSAAuthentication no