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.
1 parent ee5c39f commit 1120774Copy full SHA for 1120774
terraform/nixos-rebuild/deploy.sh
@@ -22,8 +22,11 @@ sshOpts+=(-o StrictHostKeyChecking=no)
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
+ (
27
+ umask 077
28
+ echo "$SSH_KEY" >"$sshPrivateKeyFile"
29
+ )
30
unset SSH_AUTH_SOCK # don't use system agent if key was supplied
31
sshOpts+=(-o "IdentityFile=${sshPrivateKeyFile}")
32
fi
0 commit comments