Restrict file permissions before writing key

This commit is contained in:
Anders Pitman 2020-10-07 09:04:01 -06:00
parent bf54f27815
commit 13e998e87d

View File

@ -20,8 +20,8 @@ tunnelPrivateKey=$(echo "$json" | jq -r '.tunnel_private_key')
# TODO: It would be nice if we could avoid writing the private key to disk.
# I tried process substition but it didn't work.
keyFile=$(mktemp)
printf -- "$tunnelPrivateKey" > $keyFile
chmod 0600 $keyFile
printf -- "$tunnelPrivateKey" > $keyFile
echo "Connecting to tunnel"