TL;DR:不,这些选项在 SSH-2 中无效(自 2016 年起删除了 SSH-1 支持)。
如果不确定,源代码是最好的文档。
如果我们在整个 OpenSSH 源代码中搜索ServerKeyBits
和,我们只会在以下位置找到:KeyRegenerationInterval
servconf.c
{ "serverkeybits", sDeprecated, SSHCFG_GLOBAL },
. . .
{ "keyregenerationinterval", sDeprecated, SSHCFG_GLOBAL },
. . .
case sDeprecated:
case sIgnore:
case sUnsupported:
do_log2(opcode == sIgnore ?
SYSLOG_LEVEL_DEBUG2 : SYSLOG_LEVEL_INFO,
"%s line %d: %s option %s", filename, linenum,
opcode == sUnsupported ? "Unsupported" : "Deprecated", arg);
while (arg)
arg = strdelim(&cp);
break;
换句话说,这两个选项都只是打印一个弃用警告并且没有任何效果。
然后使用责备功能,我们发现选项在2016 年 8 月 23 日的提交c38ea6348 (OpenSSH 7.4p1) 中被删除:
Remove more SSH1 server code: * Drop sshd's -k option. *
Retire configuration keywords that only apply to protocol 1, as well as the
"protocol" keyword. * Remove some related vestiges of protocol 1 support.
在此之前,它们仅用于 SSH-1。例如KeyRegenerationInterval
:
{ "keyregenerationinterval", sKeyRegenerationTime, SSHCFG_GLOBAL },
. . .
case sKeyRegenerationTime:
intptr = &options->key_regeneration_time;
goto parse_time;
在sshd.c/L1442中使用:
if ((options.protocol & SSH_PROTO_1) &&
key_used == 0) {
/* Schedule server key regeneration alarm. */
signal(SIGALRM, key_regeneration_alarm);
alarm(options.key_regeneration_time);
key_used = 1;
}
注意:对于 SSH-2,有一个更强大的RekeyLimit
.