From 101c4d3462dda56dfc111d8f26ddeb99ab68a923 Mon Sep 17 00:00:00 2001 From: Vuong Hoang Date: Tue, 21 Apr 2026 01:27:42 -0700 Subject: [PATCH] restic/vm-esh-nas: fix htpasswd-append example (single ssh, not piped pair) --- configs/restic/vm-esh-nas/README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/configs/restic/vm-esh-nas/README.md b/configs/restic/vm-esh-nas/README.md index 41e3bd6..3ba7e37 100644 --- a/configs/restic/vm-esh-nas/README.md +++ b/configs/restic/vm-esh-nas/README.md @@ -49,11 +49,18 @@ ssh -t vm-esh-nas 'sudo apt update && sudo apt install -y restic' If not already present from an earlier pass: ```bash -# Generate the bcrypt line locally (httpd:2.4-alpine throwaway container) -ssh ana-docker 'docker run --rm httpd:2.4-alpine htpasswd -nbB vm-esh-nas ""' \ - | ssh -t ana-docker 'sudo tee -a /mnt/backup/restic/repo/ana/.htpasswd >/dev/null' +# Single ssh invocation — the pipe must stay on the REMOTE side so +# sudo can prompt on the local keyboard. `ssh -t ... | ssh -t ...` +# breaks because sudo's password read conflicts with the pipe contents. +ssh -t ana-docker ' + docker run --rm httpd:2.4-alpine htpasswd -nbB vm-esh-nas "" \ + | sudo tee -a /mnt/backup/restic/repo/ana/.htpasswd >/dev/null +' ``` +Heads-up: the password is in your shell history after this runs. +Scrub with `history -d ` or `history -c`. + ### 3. Install restic creds on vm-esh-nas ```bash