Deploy site: private ~/.ssh files on the runner
Deploy test site / deploy (push) Failing after 1m32s
Deploy test site / deploy (push) Failing after 1m32s
Run 72 failed with "Bad owner or permissions on /root/.ssh/config" (a loose umask or a reused HOME on the runner). Same fix as thaiai b59230e: umask 077, a fresh config, chmod 600 on config and known_hosts.
This commit is contained in:
1 parent
4728a821f2
commit
c8ffe42125
1 file changed
+7
@@ -53,7 +53,13 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
port=${VPS_PORT:-22}
|
port=${VPS_PORT:-22}
|
||||||
|
# ssh refuses a config that is group/world-writable or owned by
|
||||||
|
# another user ("Bad owner or permissions on ~/.ssh/config"), which
|
||||||
|
# a runner with a loose umask or a reused HOME produces: create every
|
||||||
|
# file here private and fresh.
|
||||||
|
umask 077
|
||||||
mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
||||||
|
rm -f ~/.ssh/config
|
||||||
printf '%s\n' "$VPS_SSH_KEY" | tr -d '\r' > ~/.ssh/deploy_key
|
printf '%s\n' "$VPS_SSH_KEY" | tr -d '\r' > ~/.ssh/deploy_key
|
||||||
chmod 600 ~/.ssh/deploy_key
|
chmod 600 ~/.ssh/deploy_key
|
||||||
# Fail here, not at the server, when the secret is not a usable key,
|
# Fail here, not at the server, when the secret is not a usable key,
|
||||||
@@ -87,6 +93,7 @@ jobs:
|
|||||||
echo " IdentitiesOnly yes"
|
echo " IdentitiesOnly yes"
|
||||||
echo " BatchMode yes"
|
echo " BatchMode yes"
|
||||||
} > ~/.ssh/config
|
} > ~/.ssh/config
|
||||||
|
chmod 600 ~/.ssh/config ~/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Ensure rsync is available
|
- name: Ensure rsync is available
|
||||||
run: command -v rsync || (sudo apt-get update && sudo apt-get install -y rsync) || (apt-get update && apt-get install -y rsync)
|
run: command -v rsync || (sudo apt-get update && sudo apt-get install -y rsync) || (apt-get update && apt-get install -y rsync)
|
||||||
|
|||||||
Reference in new issue
Block a user