Here's the scenario, we're using GnuPG to encrypt data between 2 web servers. 1 is on RHEL. GnuPG will be accessed through cgi scripts to encrypt and decrypt. So I need a keyring that the apache user has access to. This has proven to be difficult for me on Red Hat, I was able to get this set up pretty easily on Ubuntu. Here's what I've tried to, maybe someone has a better/easier way to accomplish this.
I became the apache user
su -s /bin/bash apache
when running
gpg --gen-key
it couldn't create the .gnupg directory at /var/www, so I created that and set the owner to apache.apache. now when generating keys, I get
can't connect to `/var/www/.gnupg/S.gpg-agent': No such file or directory
gpg-agent[26949]: command get_passphrase failed: Operation cancelled
gpg: cancelled by user
gpg: Key generation canceled.
so I created that file, after reading the man page a bit (and some googling)
mknod -m 700 S.gpg-agent p
now I get
can't connect to `/var/www/.gnupg/S.gpg-agent': Connection refused
gpg-agent[26949]: command get_passphrase failed: Operation cancelled
gpg: cancelled by user
gpg: Key generation canceled.
I haven't been able to get anywhere after this as I'm getting into areas I don't know much about. I'm assuming it has to do with that apache isn't really a user in the since of having a bash profile, etc. So where do I go from here?