Cannot encrypt/decrypt zip-Files correctly (Andreas)

Joseph Bruni joseph_bruni@bigfoot.com
Wed Jun 5 04:05:01 2002


By gpg I'm assuming you mean the gpg executable? If gpg is installed in=20=

/usr/local/bin and your key files are in /usr/home/andreas/.gnupg, your=20=

command line would look like this:


/usr/local/bin/gpg --homedir /usr/home/andreas/.gnupg -o \
   /path/to/file/data.gpg -e --default-recipient andreas

The web server will need to have read access to the entire path of=20
/usr/home/andreas/.gnupg/pubring.gpg

Assuming your web server runs as "nobody" you can do this:

sudo su - nobody

if [ -r /usr/home/andreas/.gnupg/pubring.gpg ]; then
   echo "is readable"
fi




On Tuesday, June 4, 2002, at 06:58 PM, <akorthaus@web.de> wrote:

> gpg and the key-files are in different folders - which one should I=20
> choose?
>
> -- Andreas
>
>
> ----- Original Message -----
> From: "Joseph Bruni" <joseph_bruni@bigfoot.com>
> To: <gnupg-users@gnupg.org>
> Sent: Wednesday, June 05, 2002 3:52 AM
> Subject: Re: Cannot encrypt/decrypt zip-Files correctly (Andreas)
>
>
> Add a "--homedir" option to your call to gpg so that it can find your
> public key file.
>
> -Joe
>
>
>
>
> On Tuesday, June 4, 2002, at 06:28 PM, <akorthaus@web.de> wrote:
>
>> Hallo!
>>
>> Does someone now, what I have to do, if my  pgp is run by the =
webserver
>> and
>> has no home-directory, no keyrings, no keys, if I just want to get =
the
>> following script running:
>>
>> % That creates the file 'data.gpg', which I can decrypt an my PC. On=20=

>> PHP
>> this should look something like this:
>> % <?
>> % system( "gzip -c file.htm | gpg -o
>> /path/to/file/data.gpg -e --default-recipient andreas");
>> % ?>
>> If I only compress a file with gzip, there is no problem, for =
example:
>>
>> <?
>> system( "gzip -c file.htm > file.sql");
>> ?>
>>
>> this works, but pgp doesn=B4t and I don=B4t know why. The same code =
in=20
>> SHELL
>> works perfectly ?!?!
>>
>> David T-G said:
>> % ... you've neglected an important part: when the php script is run,
>> it's
>> % run by the web server, and the web server is not you, and so gpg =
has
>> no
>> % home directory, no keyrings, and no keys.
>>
>> But how can I get this information into my code? Does someone know =
what
>> to
>> do?
>>
>> --  Andreas
>>
>>
>>
>> _______________________________________________
>> Gnupg-users mailing list
>> Gnupg-users@gnupg.org
>> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>>
>
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>
>
>