Install OpenSSH Server during Windows setup
Install it at first logon from the Win32-OpenSSH zip on the seed ISO via Configure-Windows.ps1 -InstallOpenSSH, replacing the manual 05/06 batch files. The administrator public key now comes from the host (SSH_PUBLIC_KEY_FILE or ~/.ssh/id_*.pub) instead of being hardcoded. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
552a292894
commit
65a5780e02
7 files changed
+78
-128
No files matched your search
@@ -304,6 +304,13 @@ if installing_from_iso:
|
||||
seed_sources = [seed_dir / "Autounattend.xml", seed_dir / "Configure-Windows.ps1",
|
||||
*sorted(seed_dir.glob("[0-9][0-9]-*.bat"))]
|
||||
|
||||
# build-seed.sh embeds the administrator SSH public key.
|
||||
ssh_key = os.environ.get("SSH_PUBLIC_KEY_FILE") or next(
|
||||
(str(k) for n in ("id_ed25519", "id_ecdsa", "id_rsa")
|
||||
if (k := Path.home() / ".ssh" / f"{n}.pub").is_file()), None)
|
||||
if ssh_key:
|
||||
seed_sources.append(Path(ssh_key))
|
||||
|
||||
# The seed carries the OpenSSH zip for this architecture; build-seed.sh
|
||||
# downloads it when missing.
|
||||
seed_sources.append(Path(capture(
|
||||
|
||||
Reference in new issue
Block a user