Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pgp in perl

Status
Not open for further replies.

sasuser2006

Technical User
May 8, 2006
32
US
I'm running this script to encrypt in perl on a linux box...
Code:
#!/usr/bin/perl
my $key = "PGP_KEY";
my $file = $ARGV[0];

  $cmd = "sudo -u gpg /usr/bin/gpg --homedir=/u01/home/mydir/.gnupg --no-tty --encrypt --recipient \"$key\" < $file > $file.
gpg ";
  $res = system("$cmd");
  if($res) {
    print "ERROR: There was a problem...\n\t$res\n";
    exit;
  }

But i keep getting this error...

Code:
sudo: no passwd entry for gpg!
ERROR: There was a problem...
        256
Any advice would be much appreciated. Thanks in advance.
 
I just tried this and it just gives me the usage for the sudo command...it doesn't prompt me for a password.

The link was interesting and I might be able to use it but I'm curious what the password would be for "sudo"ing gpg.

Thanks for the response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top