We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ee5c39f + eafa9cf commit ac1eaafCopy full SHA for ac1eaaf
terraform/nixos-rebuild/deploy.sh
@@ -21,9 +21,11 @@ sshOpts+=(-o StrictHostKeyChecking=no)
21
22
if [[ -n ${SSH_KEY+x} && ${SSH_KEY} != "-" ]]; then
23
sshPrivateKeyFile="$workDir/ssh_key"
24
- trap 'rm "$sshPrivateKeyFile"' EXIT
25
- echo "$SSH_KEY" >"$sshPrivateKeyFile"
26
- chmod 0700 "$sshPrivateKeyFile"
+ # Create the file with 0700 - umask calculation: 777 - 700 = 077
+ (
+ umask 077
27
+ echo "$SSH_KEY" >"$sshPrivateKeyFile"
28
+ )
29
unset SSH_AUTH_SOCK # don't use system agent if key was supplied
30
sshOpts+=(-o "IdentityFile=${sshPrivateKeyFile}")
31
fi
0 commit comments