2015-08-13 15:43:12 +00:00
|
|
|
diff -up openssh-7.0p1/gss-serv-krb5.c.GSSAPIEnablek5users openssh-7.0p1/gss-serv-krb5.c
|
|
|
|
--- openssh-7.0p1/gss-serv-krb5.c.GSSAPIEnablek5users 2015-08-12 11:27:44.022407951 +0200
|
|
|
|
+++ openssh-7.0p1/gss-serv-krb5.c 2015-08-12 11:27:44.047407912 +0200
|
2015-03-20 13:56:04 +00:00
|
|
|
@@ -260,7 +260,6 @@ ssh_gssapi_krb5_cmdok(krb5_principal pri
|
2015-01-14 14:24:52 +00:00
|
|
|
FILE *fp;
|
|
|
|
char file[MAXPATHLEN];
|
2015-01-30 13:27:43 +00:00
|
|
|
char line[BUFSIZ] = "";
|
2015-01-14 14:24:52 +00:00
|
|
|
- char kuser[65]; /* match krb5_kuserok() */
|
|
|
|
struct stat st;
|
|
|
|
struct passwd *pw = the_authctxt->pw;
|
|
|
|
int found_principal = 0;
|
2015-03-20 13:56:04 +00:00
|
|
|
@@ -269,7 +268,7 @@ ssh_gssapi_krb5_cmdok(krb5_principal pri
|
2015-01-14 14:24:52 +00:00
|
|
|
|
|
|
|
snprintf(file, sizeof(file), "%s/.k5users", pw->pw_dir);
|
|
|
|
/* If both .k5login and .k5users DNE, self-login is ok. */
|
|
|
|
- if (!k5login_exists && (access(file, F_OK) == -1)) {
|
|
|
|
+ if ( !options.enable_k5users || (!k5login_exists && (access(file, F_OK) == -1))) {
|
|
|
|
return ssh_krb5_kuserok(krb_context, principal, luser,
|
|
|
|
k5login_exists);
|
|
|
|
}
|
2015-08-13 15:43:12 +00:00
|
|
|
diff -up openssh-7.0p1/servconf.c.GSSAPIEnablek5users openssh-7.0p1/servconf.c
|
|
|
|
--- openssh-7.0p1/servconf.c.GSSAPIEnablek5users 2015-08-12 11:27:44.036407930 +0200
|
|
|
|
+++ openssh-7.0p1/servconf.c 2015-08-12 11:28:49.087306430 +0200
|
|
|
|
@@ -173,6 +173,7 @@ initialize_server_options(ServerOptions
|
2015-01-14 14:24:52 +00:00
|
|
|
options->version_addendum = NULL;
|
2015-01-20 12:18:45 +00:00
|
|
|
options->fingerprint_hash = -1;
|
2015-01-14 14:24:52 +00:00
|
|
|
options->use_kuserok = -1;
|
|
|
|
+ options->enable_k5users = -1;
|
|
|
|
}
|
|
|
|
|
2015-03-20 13:56:04 +00:00
|
|
|
/* Returns 1 if a string option is unset or set to "none" or 0 otherwise. */
|
2015-08-13 15:43:12 +00:00
|
|
|
@@ -351,6 +352,8 @@ fill_default_server_options(ServerOption
|
|
|
|
options->fwd_opts.streamlocal_bind_unlink = 0;
|
|
|
|
if (options->fingerprint_hash == -1)
|
2015-01-20 12:18:45 +00:00
|
|
|
options->fingerprint_hash = SSH_FP_HASH_DEFAULT;
|
2015-01-14 14:24:52 +00:00
|
|
|
+ if (options->enable_k5users == -1)
|
|
|
|
+ options->enable_k5users = 0;
|
2015-08-13 15:43:12 +00:00
|
|
|
if (options->use_kuserok == -1)
|
|
|
|
options->use_kuserok = 1;
|
|
|
|
|
|
|
|
@@ -423,7 +426,7 @@ typedef enum {
|
2015-03-20 13:56:04 +00:00
|
|
|
sHostbasedUsesNameFromPacketOnly, sHostbasedAcceptedKeyTypes,
|
2015-08-13 15:43:12 +00:00
|
|
|
sHostKeyAlgorithms,
|
2015-03-20 13:56:04 +00:00
|
|
|
sClientAliveInterval, sClientAliveCountMax, sAuthorizedKeysFile,
|
2015-01-14 14:24:52 +00:00
|
|
|
- sGssAuthentication, sGssCleanupCreds, sGssStrictAcceptor,
|
|
|
|
+ sGssAuthentication, sGssCleanupCreds, sGssEnablek5users, sGssStrictAcceptor,
|
|
|
|
sGssKeyEx, sGssStoreRekey, sAcceptEnv, sPermitTunnel,
|
|
|
|
sMatch, sPermitOpen, sForceCommand, sChrootDirectory,
|
|
|
|
sUsePrivilegeSeparation, sAllowAgentForwarding,
|
2015-08-13 15:43:12 +00:00
|
|
|
@@ -502,12 +505,14 @@ static struct {
|
2015-01-14 14:24:52 +00:00
|
|
|
{ "gssapistrictacceptorcheck", sGssStrictAcceptor, SSHCFG_GLOBAL },
|
|
|
|
{ "gssapikeyexchange", sGssKeyEx, SSHCFG_GLOBAL },
|
|
|
|
{ "gssapistorecredentialsonrekey", sGssStoreRekey, SSHCFG_GLOBAL },
|
|
|
|
+ { "gssapienablek5users", sGssEnablek5users, SSHCFG_ALL },
|
|
|
|
#else
|
|
|
|
{ "gssapiauthentication", sUnsupported, SSHCFG_ALL },
|
|
|
|
{ "gssapicleanupcredentials", sUnsupported, SSHCFG_GLOBAL },
|
|
|
|
{ "gssapistrictacceptorcheck", sUnsupported, SSHCFG_GLOBAL },
|
|
|
|
{ "gssapikeyexchange", sUnsupported, SSHCFG_GLOBAL },
|
|
|
|
{ "gssapistorecredentialsonrekey", sUnsupported, SSHCFG_GLOBAL },
|
|
|
|
+ { "gssapienablek5users", sUnsupported, SSHCFG_ALL },
|
|
|
|
#endif
|
|
|
|
{ "gssusesessionccache", sUnsupported, SSHCFG_GLOBAL },
|
|
|
|
{ "gssapiusesessioncredcache", sUnsupported, SSHCFG_GLOBAL },
|
2015-08-13 15:43:12 +00:00
|
|
|
@@ -1680,6 +1685,10 @@ process_server_config_line(ServerOptions
|
2015-01-14 14:24:52 +00:00
|
|
|
intptr = &options->use_kuserok;
|
|
|
|
goto parse_flag;
|
|
|
|
|
|
|
|
+ case sGssEnablek5users:
|
|
|
|
+ intptr = &options->enable_k5users;
|
|
|
|
+ goto parse_flag;
|
|
|
|
+
|
|
|
|
case sPermitOpen:
|
|
|
|
arg = strdelim(&cp);
|
|
|
|
if (!arg || *arg == '\0')
|
2015-08-13 15:43:12 +00:00
|
|
|
@@ -2035,6 +2044,7 @@ copy_set_server_options(ServerOptions *d
|
2015-01-14 14:24:52 +00:00
|
|
|
M_CP_INTOPT(ip_qos_interactive);
|
|
|
|
M_CP_INTOPT(ip_qos_bulk);
|
|
|
|
M_CP_INTOPT(use_kuserok);
|
|
|
|
+ M_CP_INTOPT(enable_k5users);
|
|
|
|
M_CP_INTOPT(rekey_limit);
|
|
|
|
M_CP_INTOPT(rekey_interval);
|
|
|
|
|
2015-08-13 15:43:12 +00:00
|
|
|
@@ -2317,6 +2327,7 @@ dump_config(ServerOptions *o)
|
2015-01-14 14:24:52 +00:00
|
|
|
dump_cfg_fmtint(sUsePrivilegeSeparation, use_privsep);
|
2015-01-20 12:18:45 +00:00
|
|
|
dump_cfg_fmtint(sFingerprintHash, o->fingerprint_hash);
|
2015-01-14 14:24:52 +00:00
|
|
|
dump_cfg_fmtint(sKerberosUseKuserok, o->use_kuserok);
|
|
|
|
+ dump_cfg_fmtint(sGssEnablek5users, o->enable_k5users);
|
|
|
|
|
|
|
|
/* string arguments */
|
|
|
|
dump_cfg_string(sPidFile, o->pid_file);
|
2015-08-13 15:43:12 +00:00
|
|
|
diff -up openssh-7.0p1/servconf.h.GSSAPIEnablek5users openssh-7.0p1/servconf.h
|
|
|
|
--- openssh-7.0p1/servconf.h.GSSAPIEnablek5users 2015-08-12 11:27:44.022407951 +0200
|
|
|
|
+++ openssh-7.0p1/servconf.h 2015-08-12 11:27:44.048407911 +0200
|
|
|
|
@@ -180,7 +180,8 @@ typedef struct {
|
2015-01-14 14:24:52 +00:00
|
|
|
|
|
|
|
int num_permitted_opens;
|
|
|
|
|
|
|
|
- int use_kuserok;
|
|
|
|
+ int use_kuserok;
|
|
|
|
+ int enable_k5users;
|
|
|
|
char *chroot_directory;
|
|
|
|
char *revoked_keys_file;
|
|
|
|
char *trusted_user_ca_keys;
|
2015-08-13 15:43:12 +00:00
|
|
|
diff -up openssh-7.0p1/sshd_config.5.GSSAPIEnablek5users openssh-7.0p1/sshd_config.5
|
|
|
|
--- openssh-7.0p1/sshd_config.5.GSSAPIEnablek5users 2015-08-12 11:27:44.023407950 +0200
|
|
|
|
+++ openssh-7.0p1/sshd_config.5 2015-08-12 11:27:44.048407911 +0200
|
|
|
|
@@ -633,6 +633,12 @@ on logout.
|
2015-01-14 14:24:52 +00:00
|
|
|
The default is
|
|
|
|
.Dq yes .
|
|
|
|
Note that this option applies to protocol version 2 only.
|
|
|
|
+.It Cm GSSAPIEnablek5users
|
|
|
|
+Specifies whether to look at .k5users file for GSSAPI authentication
|
|
|
|
+access control. Further details are described in
|
|
|
|
+.Xr ksu 1 .
|
|
|
|
+The default is
|
|
|
|
+.Dq no .
|
|
|
|
.It Cm GSSAPIStrictAcceptorCheck
|
2015-06-24 12:11:59 +00:00
|
|
|
Determines whether to be strict about the identity of the GSSAPI acceptor
|
|
|
|
a client authenticates against.
|
2015-08-13 15:43:12 +00:00
|
|
|
diff -up openssh-7.0p1/sshd_config.GSSAPIEnablek5users openssh-7.0p1/sshd_config
|
|
|
|
--- openssh-7.0p1/sshd_config.GSSAPIEnablek5users 2015-08-12 11:27:44.023407950 +0200
|
|
|
|
+++ openssh-7.0p1/sshd_config 2015-08-12 11:27:44.048407911 +0200
|
2015-06-24 12:11:59 +00:00
|
|
|
@@ -94,6 +94,7 @@ GSSAPIAuthentication yes
|
|
|
|
GSSAPICleanupCredentials no
|
|
|
|
#GSSAPIStrictAcceptorCheck yes
|
|
|
|
#GSSAPIKeyExchange no
|
|
|
|
+#GSSAPIEnablek5users no
|
|
|
|
|
|
|
|
# Set this to 'yes' to enable PAM authentication, account processing,
|
|
|
|
# and session processing. If this is enabled, PAM authentication will
|