gpg Encryption, in Cron Job

Posted on 2011-10-23
Last Modified: 2012-06-21
An ecryption challenge using cron.

Below is my script... it is NOT working...

Here is the output... from command line

gpg: no valid addressees
gpg: /home/ssftp/.unencrypted/Audits_Feed_201110201702.txt: encryption failed: no such user id


for f in /home/lowessftp/.unencrypted/*.txt
  echo "Encrypting file $f ... "
  gpg --homedir /root/.gnupg --batch --no-tty  -o $
f.enc -e $f
        mv  /home/ssftp/.unencrypted/*.enc  /home/ssftp/export
        mv $f  /home/ssftp/.unencrypted/archive
Question by:martinmiller40
    LVL 17

    Expert Comment

    add the recipient mail address (whose public key must be in the key ring) with "--recipient"

    Author Comment

    I got a little farther, and other ideas to this output ?
     Thx Martin
    [root@lnn1111 .unencrypted]# sh /etc/cron.hourly/
    Encrypting file /home/ssftp/.unencrypted/Factory_Audits_Feed_201110201702.txt ...
    gpg: skipped: unusable public key
    gpg: /home/ssftp/.unencrypted/Factory_Audits_Feed_201110201702.txt: encryption failed: unusable public key
    LVL 17

    Accepted Solution

    Did you sign the key or trust it? Most likely not. Either sign it using your private key, or alter the key so GPG will trust it:

    $ gpg --edit the@key.adr
    Command > trust
    Please decide how far you trust this user to correctly
    verify other users' keys (by looking at passports,
    checking fingerprints from different sources...)?
     1 = Don't know
     2 = I do NOT trust
     3 = I trust marginally
     4 = I trust fully
     5 = I trust ultimately
     m = back to the main menu
    Your decision? 5
    Do you really want to set this key to ultimate trust? y
    Command > save

    Open in new window

    Once done, you should be able to use it ... (signing the key also sets the trust to "5")

    Author Closing Comment

    Thank you!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    #SSL #TLS #Citrix #HTTPS #PKI #Compliance #Certificate #Encryption #StoreFront #Web Interface #Citrix XenApp
    Cybersecurity has become the buzzword of recent years and years to come. The inventions of cloud infrastructure and the Internet of Things has made us question our online safety. Let us explore how cloud- enabled cybersecurity can help us with our b…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now