Ale*_*yak 19 ssh configuration
具体AllowUsers
参数:
例如转换这个
AllowUsers user1 user2 user3 user4
Run Code Online (Sandbox Code Playgroud)
对此
AllowUsers
user1
user2
user3
user4
Run Code Online (Sandbox Code Playgroud)
Gil*_*il' 13
不,但在这种情况下它没有用。可以有多个AcceptEnv
,AllowGroups
,AllowUsers
,DenyGroups
,DenyUsers
,HostKey
,PermitOpen
,Port
和Subsystem
线,并且每条线将一个或多个(或有时零)元素到列表中。
尽管如此,如果您不能轻松地将AllowUsers
指令放在一行中,我建议创建一个ssh_allowed
组并使用AllowGroups ssh_allowed
in sshd_config
。
Mic*_*zek 12
简而言之,它看起来像没有
OpenSSHservconf.c
将文件转储到缓冲区中而不检查这些事情(它似乎只是寻找#
标记注释):
while (fgets(line, sizeof(line), f)) {
if ((cp = strchr(line, '#')) != NULL)
memcpy(cp, "\n", 2);
cp = line + strspn(line, " \t\r");
buffer_append(conf, cp, strlen(cp));
}
Run Code Online (Sandbox Code Playgroud)
解析配置的函数然后在换行符上拆分缓冲区并处理每一行:
while ((cp = strsep(&cbuf, "\n")) != NULL) {
if (process_server_config_line(options, cp, filename,
linenum++, &active, user, host, address) != 0)
bad_options++;
}
Run Code Online (Sandbox Code Playgroud)