create-lxc: prompt for root password, enable sshd when set
Accepts ROOT_PASSWORD from env or reads from /dev/tty (works under curl|bash). When set, pipes it through `chpasswd` via stdin (secret stays out of argv) and installs+enables openssh with PermitRootLogin yes. Skipping leaves the prior no-password behavior intact so pct enter remains the fallback.
This commit is contained in:
1 parent
4e7e0f34ba
commit
eaca8305ae
2 files changed
+53
-1
No files matched your search
@@ -34,7 +34,17 @@ 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`.
|
||||
Available overrides: `HOSTNAME`, `CORES`, `MEMORY`, `DISK`, `BRIDGE`, `STORAGE`, `TEMPLATE_STORAGE`, `WIRECON_REPO`, `WIRECON_REF`, `ROOT_PASSWORD`.
|
||||
|
||||
### Root login
|
||||
|
||||
The script prompts for a root password (reads from `/dev/tty`, works under `curl | bash`) and, if one is given, installs `openssh`, flips `PermitRootLogin yes`, and enables `sshd`. You can also preset it:
|
||||
|
||||
```
|
||||
ROOT_PASSWORD='hunter2' bash -c "$(curl -fsSL …/create-lxc.sh)"
|
||||
```
|
||||
|
||||
Leave it empty / skip the prompt and the container has **no root password** — you enter it from the Proxmox host with `pct enter <VMID>`. SSH won't work in that case.
|
||||
|
||||
## Finishing up (inside the LXC)
|
||||
|
||||
|
||||
Reference in new issue
Block a user