1
0
Fork 0

Added gen-salt.sh to generate and get a SetCredentialEncrypted= to put in a systemd service.

This commit is contained in:
Alexander Andreev 2023-05-24 22:22:11 +04:00
parent badeda87ad
commit 57aea7ef77
Signed by: Arav
GPG Key ID: D22A817D95815393
1 changed files with 12 additions and 0 deletions

12
tools/gen-salt.sh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/sh
if [[ $1 ]]; then
char_num=$1;
else
char_num=64;
fi
cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#$%^&*' | fold -w $char_num | head -n 1 | systemd-creds encrypt -p - /tmp/salt
cat /tmp/salt
rm /tmp/salt