Fix problems in umask

You must set the umask to not spill the directory permissions

$> umask
022
$> echo asdf1234 > password
$> ls -la password
-rw-r--r-- 1 bebe bebe 9  2. Dez 21:29 password
$> rm password
$> (umask 077; echo "my-super-safe-password" > password)
$> ls -la password
-rw------- 1 bebe bebe 23 Dec  2 21:28 password
This commit is contained in:
Benedikt Heine 2024-12-02 21:28:49 +01:00
parent ef3c145b7b
commit 89ae4455bb

View file

@ -80,7 +80,7 @@ used flakes:
```bash ```bash
# enter disk encryption key # enter disk encryption key
echo "my-super-safe-password" > /tmp/disk.key (umask 077; echo "my-super-safe-password" > /tmp/disk.key)
temp=$(mktemp -d) temp=$(mktemp -d)
# ssh-host keys # ssh-host keys
@ -98,7 +98,7 @@ used flakes:
1. existing host 1. existing host
```bash ```bash
echo "my-super-safe-password" > /tmp/disk.key (umask 077; echo "my-super-safe-password" > /tmp/disk.key)
temp=$(mktemp -d) temp=$(mktemp -d)
find $temp -printf '%M %p\n' find $temp -printf '%M %p\n'
``` ```