I want to write a script that automatically encrypts a file using gpg and a password that is saved in a file.
I tried this:
gpg -c --passphrase-fd 0 file.txt < pass.txt
When I run this on an Ubuntu 16.04 server, it encrypts the file, as expected. When I run it on an Ubuntu 18.04 desktop, it asks me for a passphrase, using the Password Manager modal dialog.
How can I skip the dialog and do a non-interactive encryption?
As a workaround, I did this using openssl instead of gpg:
openssl aes-256-cbc -pass file:pass.txt -e -in file.txt -out file.txt.enc