fix(chv-guest): 首启缺 key 时才生成 host key(B-23)
Minimal 底座 cloud.cfg 不含 ssh 模块,build.sh 又写 ssh_genkeytypes: [] 彻底关掉首启生成:客机无 host key、 sshd -t 失败、ssh.service 连败 5 次,SSH 全程不通(真机 冒烟 131s 未通,console 已到 login、ping 通、tap 正常)。 修正:99-chv-hostkey.cfg 改写首启 bootcmd,只在缺 ed25519 key 时 ssh-keygen -A;ssh_deletekeys: false 保留, 绝不重生成已预置的 per-VM key(bootcmd 跑在 seed write_files 之前,预置 key 随后覆盖生成值)。README §5 同步修正;新增 BuildScriptTest 回归断言。
This commit is contained in:
1 parent
dcb0824f78
commit
cbd5ab7c0b
3 files changed
+33
-7
No files matched your search
+6
-4
@@ -84,10 +84,12 @@ KVM;全量模式在无 /dev/kvm 的机器上第一步就明确退出
|
||||
第二块只读盘)由执行器在 VM 启动前生成,含 meta-data 与 user-data);
|
||||
- 首启时先应用 seed 再启动 sshd,seed 里的 user-data
|
||||
把该 VM 的 host key 对写进 /etc/ssh/ 并重启 sshd;
|
||||
- 镜像里已钉死 `ssh_deletekeys: false` 与
|
||||
`ssh_genkeytypes: []`(build.sh 已写),首启不得无条件
|
||||
重新生成 host key——重生成会使预置的 known_hosts 立即
|
||||
失效,SSH 钉死直接拒绝,这是设计,不是 bug;
|
||||
- 镜像里已钉死 `ssh_deletekeys: false`(build.sh 已写),首启
|
||||
不得无条件重新生成 host key——重生成会使预置的 known_hosts
|
||||
立即失效,SSH 钉死直接拒绝,这是设计,不是 bug;无预置 key
|
||||
时首启 bootcmd 只在缺 key 时 `ssh-keygen -A` 生成(B-23:
|
||||
曾写 `ssh_genkeytypes: []` 彻底关掉首启生成,客机 sshd 起
|
||||
不来,已删,绝不再写);
|
||||
- sshd 只允许 key 登录,禁止密码登录(build.sh 写入
|
||||
/etc/ssh/sshd_config.d/99-chv.conf:PasswordAuthentication no、
|
||||
PermitRootLogin prohibit-password、ChallengeResponseAuthentication no、
|
||||
|
||||
Reference in new issue
Block a user