diff --git a/CLAUDE.md b/CLAUDE.md index fc311ff..d87803b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -52,6 +52,15 @@ without re-measuring: - Node Prometheus is on **9615**, not 9616. Upstream's `MINING.md` parameter table is wrong about this; the running binary is the authority. +## `gitea_ci` needs a real shell + +Create it with `/bin/bash`, never `/usr/sbin/nologin`. The deploy runs +`ssh gitea_ci@host `; a nologin shell authenticates the key and then +refuses the command with "This account is currently not available". Every +pre-existing `gitea_ci` on the fleet has bash — `infra-setup.sh` repairs one that +does not, because a host provisioned with nologin can never be deployed to and +the failure looks like an auth problem rather than a shell one. + ## Hardening knobs that are load-bearing `RestrictAddressFamilies` on the node **must** include `AF_NETLINK`. libp2p calls diff --git a/script/infra-setup.sh b/script/infra-setup.sh index 5014aa9..57a15ee 100755 --- a/script/infra-setup.sh +++ b/script/infra-setup.sh @@ -80,13 +80,23 @@ provision_node() { ssh "${ADMIN_USER}@${host}" "sudo bash -seu -- '$(cat "$PUBKEY")'" <<'REMOTE' PUBKEY="$1" + # /bin/bash, NOT nologin. The deploy runs `ssh gitea_ci@host `, and + # a nologin shell refuses that with "This account is currently not + # available": the key authenticates, then the command cannot run. Every + # pre-existing gitea_ci on this fleet has bash, so a nologin one is a bug — + # repair it rather than leaving a host that can never be deployed to. if ! getent passwd gitea_ci >/dev/null; then useradd --system --create-home --home-dir /var/lib/gitea_ci \ - --shell /usr/sbin/nologin gitea_ci + --shell /bin/bash gitea_ci echo " + created gitea_ci" else echo " = gitea_ci already present" fi + cur=$(getent passwd gitea_ci | cut -d: -f7) + if [ "$cur" != /bin/bash ]; then + usermod -s /bin/bash gitea_ci + echo " ~ gitea_ci shell was ${cur} — set to /bin/bash so ssh commands can run" + fi install -d -o gitea_ci -g gitea_ci -m 0700 /var/lib/gitea_ci/.ssh ak=/var/lib/gitea_ci/.ssh/authorized_keys @@ -143,13 +153,23 @@ provision_miner() { ssh "${ADMIN_USER}@${host}" "sudo bash -seu -- '$(cat "$PUBKEY")'" <<'REMOTE' PUBKEY="$1" + # /bin/bash, NOT nologin. The deploy runs `ssh gitea_ci@host `, and + # a nologin shell refuses that with "This account is currently not + # available": the key authenticates, then the command cannot run. Every + # pre-existing gitea_ci on this fleet has bash, so a nologin one is a bug — + # repair it rather than leaving a host that can never be deployed to. if ! getent passwd gitea_ci >/dev/null; then useradd --system --create-home --home-dir /var/lib/gitea_ci \ - --shell /usr/sbin/nologin gitea_ci + --shell /bin/bash gitea_ci echo " + created gitea_ci" else echo " = gitea_ci already present" fi + cur=$(getent passwd gitea_ci | cut -d: -f7) + if [ "$cur" != /bin/bash ]; then + usermod -s /bin/bash gitea_ci + echo " ~ gitea_ci shell was ${cur} — set to /bin/bash so ssh commands can run" + fi install -d -o gitea_ci -g gitea_ci -m 0700 /var/lib/gitea_ci/.ssh ak=/var/lib/gitea_ci/.ssh/authorized_keys @@ -219,13 +239,23 @@ provision_metrics() { ssh "${ADMIN_USER}@${host}" "sudo bash -seu -- '$(cat "$PUBKEY")'" <<'REMOTE' PUBKEY="$1" + # /bin/bash, NOT nologin. The deploy runs `ssh gitea_ci@host `, and + # a nologin shell refuses that with "This account is currently not + # available": the key authenticates, then the command cannot run. Every + # pre-existing gitea_ci on this fleet has bash, so a nologin one is a bug — + # repair it rather than leaving a host that can never be deployed to. if ! getent passwd gitea_ci >/dev/null; then useradd --system --create-home --home-dir /var/lib/gitea_ci \ - --shell /usr/sbin/nologin gitea_ci + --shell /bin/bash gitea_ci echo " + created gitea_ci" else echo " = gitea_ci already present" fi + cur=$(getent passwd gitea_ci | cut -d: -f7) + if [ "$cur" != /bin/bash ]; then + usermod -s /bin/bash gitea_ci + echo " ~ gitea_ci shell was ${cur} — set to /bin/bash so ssh commands can run" + fi install -d -o gitea_ci -g gitea_ci -m 0700 /var/lib/gitea_ci/.ssh ak=/var/lib/gitea_ci/.ssh/authorized_keys touch "$ak"