Added gen-salt.sh to generate and get a SetCredentialEncrypted= to put in a systemd service.
This commit is contained in:
parent
badeda87ad
commit
57aea7ef77
12
tools/gen-salt.sh
Executable file
12
tools/gen-salt.sh
Executable 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
|
Loading…
Reference in New Issue
Block a user