问题原文
原帖链接 · jma · CC BY-SA 4.0
My /etc/ssh/sshd_config ends with this line:
Include sshd_config.d/sftp_users.conf
The contents of that file are not included, however. Including by absolute path or with a glob doesn't change anything.
To convince myself that it's really not being read, I strace'd sshd (output below). Definitely not being read. And yet support for Include is supposedly present since 7.3p1 and apparently committed on 1 Feb 2020 (prior to 31 Mar 2020).
Although I can put my included files in the main sshd_config, it is convenient to push customisations into sshd_config.d/*conf.
Any suggestions why this doesn't work?
This is an ubuntu 20.04 image, fwiw.
Update
Using the -ddd option to sshd,
/usr/sbin/sshd -ddd
I discovered that including with relative pathnames, which appeared to me to be spec'd to work, does not work. Changing to an absolute pathname reports that the config is now being read:
debug2: /etc/ssh/sshd_config line 9: new include /etc/ssh/sshd_config.d/sftp_users.conf
debug2: /etc/ssh/sshd_config line 9: including /etc/ssh/sshd_config.d/sftp_users.conf
debug2: load_server_config: filename /etc/ssh/sshd_config.d/sftp_users.conf
debug2: load_server_config: done config len = 182
debug2: parse_server_config_depth: config /etc/ssh/sshd_config.d/sftp_users.conf len 182
debug3: checking syntax for 'Match Group sftp_users'
but the pattern never matches, whereas it does match if the Match block is in sshd_config itself.
社区高分解答
原帖链接 · jetboy · CC BY-SA 4.0
Something seems off. My fresh install of 20.04.2 LTS Server has a /etc/ssh/sshd_config
Include /etc/ssh/sshd_config.d/*.conf
That includes .conf files successfully. It's been the same for every version of LTS Server I've used. I can't comment on other images.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
