create-lxc: drop sshd, enable tty1 auto-login instead
Access is now via the Proxmox web Console (or pct enter) — no SSH, no keys, no passwords. /etc/inittab's tty1 line is rewritten to `getty -n -l /usr/local/sbin/autologin-root` which execs `login -f root`, dropping straight into a root shell when the Console button is clicked.
This commit is contained in:
1 parent
1ab70a6f9a
commit
4c9df1941d
2 files changed
+28
-51
No files matched your search
@@ -34,22 +34,16 @@ HOSTNAME=tunbox MEMORY=512 STORAGE=fast-nvme \
|
||||
bash -c "$(curl -fsSL https://git.d4nn13.de/d4nn13/wirecon/raw/branch/main/proxmox/create-lxc.sh)"
|
||||
```
|
||||
|
||||
Available overrides: `HOSTNAME`, `CORES`, `MEMORY`, `DISK`, `BRIDGE`, `STORAGE`, `TEMPLATE_STORAGE`, `WIRECON_REPO`, `WIRECON_REF`, `SSH_PUBKEY`, `WIRECON_WEB_AUTOSTART` (yes/no).
|
||||
Available overrides: `HOSTNAME`, `CORES`, `MEMORY`, `DISK`, `BRIDGE`, `STORAGE`, `TEMPLATE_STORAGE`, `WIRECON_REPO`, `WIRECON_REF`, `WIRECON_WEB_AUTOSTART` (yes/no).
|
||||
|
||||
The script also asks (interactively, default **yes**) whether to enable the web UI on boot. Edit configs in-browser right after provisioning instead of `vi`'ing over `pct enter`.
|
||||
The script also asks (interactively, default **yes**) whether to enable the web UI on boot. Edit configs in-browser right after provisioning.
|
||||
|
||||
### Shell access (passwordless, key-only)
|
||||
### Shell access
|
||||
|
||||
No password is ever set. The script installs `openssh`, enables `sshd`, and authorizes root SSH keys:
|
||||
No password, no SSH. Access is via the Proxmox **Console** button or `pct enter <VMID>` from the host:
|
||||
|
||||
- **Always added:** the Proxmox host's `/root/.ssh/id_ed25519.pub`. The script generates this keypair if it doesn't exist, so `ssh root@<lxc-ip>` from the Proxmox host works immediately.
|
||||
- **Optionally added:** whatever you pass in `SSH_PUBKEY` — either a literal key string or a path to a file containing one or more keys. Example:
|
||||
|
||||
```
|
||||
SSH_PUBKEY=~/.ssh/id_ed25519.pub bash -c "$(curl -fsSL …/create-lxc.sh)"
|
||||
```
|
||||
|
||||
Alpine's default `PermitRootLogin prohibit-password` stays in place — root is reachable with a key, password auth is refused. `pct enter <VMID>` from the Proxmox host remains available as a fallback.
|
||||
- `tty1` is wired to `getty -n -l /usr/local/sbin/autologin-root`, which execs `login -f root` → you land directly in a root shell with no prompt.
|
||||
- This is safe in practice: anyone who can open the web Console is already a Proxmox admin and could `pct enter` anyway.
|
||||
|
||||
## Finishing up (inside the LXC)
|
||||
|
||||
|
||||
Reference in new issue
Block a user