How to use same gpg keys on different machines?

Solution Verified - Updated -

Issue

I have generated gpg keys on one machine but I would like to use same keys on different server to sign my rpm packages.
I have copied .rpmmacros from one server to another but rpm --resign package.rpm returns gpg: signing failed: No secret key

Environment

Red Hat Enterprise Linux (RHEL) 6.
Red Hat Enterprise Linux (RHEL) 5.5 and later.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content