feat: polish - remote deployment

This commit is contained in:
Ryan Yin 2024-02-04 17:28:20 +08:00
parent ec9f872d2f
commit 58429adade
3 changed files with 8 additions and 3 deletions

View File

@ -430,7 +430,7 @@ function themeConfigChinese() {
link: "/zh/best-practices/nix-path-and-flake-registry.md",
},
{
text: "远程部署 Nix 配置",
text: "远程部署 NixOS 配置",
link: "/zh/best-practices/remote-deployment.md",
},
{

View File

@ -14,9 +14,12 @@ Let me briefly guide you through using colmena or `nixos-rebuild` for remote dep
Before embarking on remote deployment, a few preparatory steps are necessary:
1. To prevent sudo password verification failures, either deploy as the `root` user or grant the user sudo permission without password verification.
1. To prevent remote host's sudo password verification failure, choose one of the following methods:
1. Deploy as the remote host's `root` user.
2. Add `security.sudo.wheelNeedsPassword = false;` to the remote host's configuration and manually deploy once in advance to grant the user passwordless sudo permissions..
2. Configure SSH public key authentication for the remote hosts.
It's advisable to use the `root` user for deployment as it's more convenient and avoids the complexities of sudo permissions.
Assuming we intend to deploy remotely using the root user, the initial step involves configuring SSH public key authentication for the root user on the remote host.

View File

@ -13,7 +13,9 @@ Nix 本身的设计就很适合远程部署Nix 社区也有许多专门用于
在进行远程部署之前,需要做一些准备工作:
1. 为了防止 sudo 密码验证失败,要么以 `root` 用户身份部署,要么为用户授予免密码验证的 sudo 权限。
1. 为了防止远程主机的 sudo 密码验证失败,有两种方法,二选一:
1. 以远程主机的 `root` 用户身份部署
2. 在远程主机的配置中添加 `security.sudo.wheelNeedsPassword = false;` 并提前手动部署一次,从而为用户授予免密码验证的 sudo 权限。
2. 为远程主机配置 SSH 公钥身份验证。
建议使用 `root` 用户进行部署,因为这更方便且不需要额外的配置,没有令人头疼的 sudo 权限问题。