mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2025-06-22 04:51:29 +02:00
fix: openssh config in nixos 23.05
This commit is contained in:
parent
d6cce1383e
commit
abe0a20ddb
@ -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...
|
||||
|
@ -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
|
||||
};
|
||||
|
||||
# 省略其他配置......
|
||||
|
Loading…
x
Reference in New Issue
Block a user