Skip to content

[Bug] The SSH configuration being read is incorrect. #11899

@zvrh

Description

@zvrh

Contact Information

No response

1Panel Version

v2.1.0

Problem Description

在 Debian 中官方推荐 sshd 配置写在 /etc/ssh/sshd_config.d/ 目录中,而且存在默认的 Include /etc/ssh/sshd_config.d/*.conf 配置。

但是面板是直接读取的 /etc/ssh/sshd_config 文件,没有正确获取到子目录的配置信息,应该使用命令 sshd -T 来读取实际生效配置。

Steps to Reproduce

  1. 注释掉 /etc/ssh/sshd_config 配置中的 Port 22
  2. 增加配置文件 /etc/ssh/sshd_config.d/test.conf ,并写入 Port 37337
  3. 重载配置 sudo systemctl reload sshd
  4. sudo sshd -T 查看sshd端口已修改为 37337,但面板 UI 中仍然显示默认的22端口
Image

The expected correct result

No response

Related log output

Additional Information

No response

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions