From 575529f159726fe82e5ec658e7f1756908f5a6d1 Mon Sep 17 00:00:00 2001 From: luochen570 <1160510664@qq.com> Date: Wed, 27 May 2026 07:02:37 +0800 Subject: [PATCH] modified: README.md modified: modules/server/README.md new file: modules/server/lxc-ssh.nix modified: profiles/lxc.nix --- README.md | 4 ++-- modules/server/README.md | 1 + modules/server/lxc-ssh.nix | 8 ++++++++ profiles/lxc.nix | 9 +-------- 4 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 modules/server/lxc-ssh.nix diff --git a/README.md b/README.md index 6a05682..37f474d 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ nixos/ │ ├── server/ # 服务器 │ ├── wsl/ # WSL (NixOS-WSL) │ ├── virtualbox/ # VirtualBox 虚拟机 -│ └── nixos-lxc/ # Proxmox LXC 容器 (s0.sermc.net) +│ └── nixos-lxc/ # Proxmox LXC 容器 └── secrets/ # sops-nix 加密密钥(不公开) └── users/luochen570.enc.yaml ``` @@ -70,7 +70,7 @@ nixos/ | `server` | server | x86_64-linux | 服务器 | | `nixos-wsl` | wsl | x86_64-linux | WSL | | `virtualbox` | virtualbox | x86_64-linux | VirtualBox 虚拟机 | -| `nixos-lxc` | lxc | x86_64-linux | Proxmox LXC 容器 (s0.sermc.net) | +| `nixos-lxc` | lxc | x86_64-linux | Proxmox LXC 容器 | ## 使用 diff --git a/modules/server/README.md b/modules/server/README.md index b1f172a..a7b1094 100644 --- a/modules/server/README.md +++ b/modules/server/README.md @@ -7,6 +7,7 @@ 🗄️ modules/server ├─ 📦 default.nix # 聚合入口 ├─ 🔐 ssh.nix # OpenSSH 参数 +├─ 🔐 lxc-ssh.nix # LXC OpenSSH 覆盖参数 ├─ 🐳 docker.nix # Docker 与清理策略 └─ 📝 README.md ``` diff --git a/modules/server/lxc-ssh.nix b/modules/server/lxc-ssh.nix new file mode 100644 index 0000000..9195a2f --- /dev/null +++ b/modules/server/lxc-ssh.nix @@ -0,0 +1,8 @@ +{ + # LXC 容器需要密码登录 + services.openssh.settings = { + PermitRootLogin = "prohibit-password"; + PasswordAuthentication = true; + KbdInteractiveAuthentication = true; + }; +} diff --git a/profiles/lxc.nix b/profiles/lxc.nix index f7d91fb..e966cc4 100644 --- a/profiles/lxc.nix +++ b/profiles/lxc.nix @@ -1,14 +1,7 @@ -{ ... }: { imports = [ ../modules/core ../modules/server + ../modules/server/lxc-ssh.nix ]; - - # LXC 容器需要密码登录(s0.sermc.net,无 SSH key 注入) - services.openssh.settings = { - PermitRootLogin = "prohibit-password"; - PasswordAuthentication = true; - KbdInteractiveAuthentication = true; - }; }