fix: openssh config in nixos 23.05

This commit is contained in:
Ryan Yin 2023-07-08 12:43:59 +08:00
parent d6cce1383e
commit abe0a20ddb
2 changed files with 12 additions and 8 deletions

View File

@ -40,13 +40,15 @@ To illustrate how to use `/etc/nixos/configuration.nix`, let's consider an examp
];
};
# Enable openssh-server
# Enable the OpenSSH daemon.
services.openssh = {
enable = true;
permitRootLogin = "no"; # Disable root login
passwordAuthentication = false; # Disable password login
settings = {
X11Forwarding = true;
PermitRootLogin = "no"; # disable root login
PasswordAuthentication = false; # disable password login
};
openFirewall = true;
forwardX11 = true; # Enable X11 forwarding
};
# Omit the rest of the configuration...
@ -68,4 +70,4 @@ To find configuration options and documentation:
## References
- [Overview of the NixOS Linux distribution](https://nixos.wiki/wiki/Overview_of_the_NixOS_Linux_distribution)
- [Overview of the NixOS Linux distribution](https://nixos.wiki/wiki/Overview_of_the_NixOS_Linux_distribution)

View File

@ -51,10 +51,12 @@ NixOS 的系统配置路径为 `/etc/nixos/configuration.nix`,它包含系统
# 启用 OpenSSH 后台服务
services.openssh = {
enable = true;
permitRootLogin = "no"; # disable root login
passwordAuthentication = false; # disable password login
settings = {
X11Forwarding = true;
PermitRootLogin = "no"; # disable root login
PasswordAuthentication = false; # disable password login
};
openFirewall = true;
forwardX11 = true; # enable X11 forwarding
};
# 省略其他配置......