gpg key generation
This commit is contained in:
parent
bd33b8145c
commit
f0692f51fe
|
@ -144,7 +144,7 @@ echo "Name-Real: $ADD_USERNAME" >> /home/$ADD_USERNAME/gpg-genkey.conf
|
||||||
echo "Name-Email: $ADD_USERNAME@$HOSTNAME" >> /home/$ADD_USERNAME/gpg-genkey.conf
|
echo "Name-Email: $ADD_USERNAME@$HOSTNAME" >> /home/$ADD_USERNAME/gpg-genkey.conf
|
||||||
echo 'Expire-Date: 0' >> /home/$ADD_USERNAME/gpg-genkey.conf
|
echo 'Expire-Date: 0' >> /home/$ADD_USERNAME/gpg-genkey.conf
|
||||||
chown $ADD_USERNAME:$ADD_USERNAME /home/$ADD_USERNAME/gpg-genkey.conf
|
chown $ADD_USERNAME:$ADD_USERNAME /home/$ADD_USERNAME/gpg-genkey.conf
|
||||||
su -m root -c "gpg --homedir /home/$ADD_USERNAME/.gnupg --batch --passphrase '' --gen-key /home/$ADD_USERNAME/gpg-genkey.conf" - $ADD_USERNAME
|
su -m root -c "gpg --homedir /home/$ADD_USERNAME/.gnupg --batch --passphrase '' --full-gen-key /home/$ADD_USERNAME/gpg-genkey.conf" - $ADD_USERNAME
|
||||||
chown -R $ADD_USERNAME:$ADD_USERNAME /home/$ADD_USERNAME/.gnupg
|
chown -R $ADD_USERNAME:$ADD_USERNAME /home/$ADD_USERNAME/.gnupg
|
||||||
shred -zu /home/$ADD_USERNAME/gpg-genkey.conf
|
shred -zu /home/$ADD_USERNAME/gpg-genkey.conf
|
||||||
MY_GPG_PUBLIC_KEY_ID=$(gpg_pubkey_from_email "$ADD_USERNAME" "$ADD_USERNAME@$HOSTNAME")
|
MY_GPG_PUBLIC_KEY_ID=$(gpg_pubkey_from_email "$ADD_USERNAME" "$ADD_USERNAME@$HOSTNAME")
|
||||||
|
|
|
@ -1499,7 +1499,7 @@ function create_gpg_subkey {
|
||||||
echo "Name-Comment: $GPG_KEY_USAGE" >> /home/$MY_USERNAME/gpg-genkey.conf
|
echo "Name-Comment: $GPG_KEY_USAGE" >> /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
echo 'Expire-Date: 0' >> /home/$MY_USERNAME/gpg-genkey.conf
|
echo 'Expire-Date: 0' >> /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/gpg-genkey.conf
|
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
su -m root -c "gpg --homedir /home/$MY_USERNAME/.gnupg --batch --passphrase '' --gen-key /home/$MY_USERNAME/gpg-genkey.conf" - $MY_USERNAME
|
su -m root -c "gpg --homedir /home/$MY_USERNAME/.gnupg --batch --passphrase '' --full-gen-key /home/$MY_USERNAME/gpg-genkey.conf" - $MY_USERNAME
|
||||||
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
|
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
|
||||||
|
|
||||||
shred -zu /home/$MY_USERNAME/gpg-genkey.conf
|
shred -zu /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
|
@ -1614,7 +1614,7 @@ function configure_gpg {
|
||||||
echo 'Expire-Date: 0' >> /home/$MY_USERNAME/gpg-genkey.conf
|
echo 'Expire-Date: 0' >> /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/gpg-genkey.conf
|
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
echo $'Generating a new GPG key'
|
echo $'Generating a new GPG key'
|
||||||
su -m root -c "gpg --homedir /home/$MY_USERNAME/.gnupg --batch --passphrase '' --gen-key /home/$MY_USERNAME/gpg-genkey.conf" - $MY_USERNAME
|
su -m root -c "gpg --homedir /home/$MY_USERNAME/.gnupg --batch --passphrase '' --full-gen-key /home/$MY_USERNAME/gpg-genkey.conf" - $MY_USERNAME
|
||||||
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
|
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
|
||||||
KEY_EXISTS=$(gpg_key_exists "$MY_USERNAME" "$MY_EMAIL_ADDRESS")
|
KEY_EXISTS=$(gpg_key_exists "$MY_USERNAME" "$MY_EMAIL_ADDRESS")
|
||||||
if [[ $KEY_EXISTS == "no" ]]; then
|
if [[ $KEY_EXISTS == "no" ]]; then
|
||||||
|
|
|
@ -72,7 +72,7 @@ function configure_backup_key {
|
||||||
echo 'Expire-Date: 0' >> /home/$MY_USERNAME/gpg-genkey.conf
|
echo 'Expire-Date: 0' >> /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/gpg-genkey.conf
|
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
echo $'Backup key does not exist. Creating it.'
|
echo $'Backup key does not exist. Creating it.'
|
||||||
su -m root -c "gpg --homedir /home/$MY_USERNAME/.gnupg --batch --passphrase '' --gen-key /home/$MY_USERNAME/gpg-genkey.conf" - $MY_USERNAME
|
su -m root -c "gpg --homedir /home/$MY_USERNAME/.gnupg --batch --passphrase '' --full-gen-key /home/$MY_USERNAME/gpg-genkey.conf" - $MY_USERNAME
|
||||||
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
|
chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/.gnupg
|
||||||
|
|
||||||
shred -zu /home/$MY_USERNAME/gpg-genkey.conf
|
shred -zu /home/$MY_USERNAME/gpg-genkey.conf
|
||||||
|
|
Loading…
Reference in New Issue