[deyu1@kvm8 ~]$ gpg --output demo.dyw.gpg --encrypt --recipient dywang7@gamil.com demo.txt
gpg: 26F7F452: There is no assurance this key belongs to the named user
pub 2048R/26F7F452 2013-06-20 De-Yu Wang (rhcx) <dywang7@gamil.com>
Primary key fingerprint: C6DA 8C49 D1C5 ED1C 9029 C170 01A0 B0F1 907C E30E
Subkey fingerprint: FF88 0E58 B9E7 A426 1349 85C7 238F 64EA 26F7 F452
It is NOT certain that the key belongs to the person named
in the user ID. If you *really* know what you are doing,
you may answer the next question with yes.
Use this key anyway? (y/N) y
[deyu1@kvm8 ~]$ ll demo.dyw.gpg -rw-r--r--. 1 root root 347 Jun 5 11:13 demo.dyw.gpg
[deyu1@kvm8 ~]$ scp demo.dyw.gpg dywang@192.168.122.1:Documents/latex/rhcx
[dywang@dywhd2 rhcx]$ gpg --decrypt demo.dyw.gpg
You need a passphrase to unlock the secret key for
user: "De-Yu Wang (rhcx) <dywang7@gamil.com>"
2048-bit RSA key, ID 26F7F452, created 2013-06-20 (main key ID 907CE30E)
gpg: problem with the agent: No pinentry
gpg: encrypted with 2048-bit RSA key, ID 26F7F452, created 2013-06-20
"De-Yu Wang (rhcx) <dywang7@gamil.com>"
gpg: public key decryption failed: General error
gpg: decryption failed: No secret key
[dywang@dywhd2 rhcx]$ unset DISPLAY
[dywang@dywhd2 rhcx]$ gpg --decrypt demo.dyw.gpg
┌───────────────────────────────────────────────────────────────────────┐
│ Please enter the passphrase to unlock the secret key for the OpenPGP │
│ certificate: │
│ "De-Yu Wang (rhcx) <dywang7@gamil.com>" │
│ 2048-bit RSA key, ID 26F7F452, │
│ created 2013-06-20 (main key ID 907CE30E). │
│ │
│ │
│ Passphrase __________________________________________________________ │
│ │
│ <OK> <Cancel> │
└───────────────────────────────────────────────────────────────────────┘
You need a passphrase to unlock the secret key for
user: "De-Yu Wang (rhcx) <dywang7@gamil.com>"
2048-bit RSA key, ID 26F7F452, created 2013-06-20 (main key ID 907CE30E)
gpg: Invalid passphrase; please try again ...
You need a passphrase to unlock the secret key for
user: "De-Yu Wang (rhcx) <dywang7@gamil.com>"
2048-bit RSA key, ID 26F7F452, created 2013-06-20 (main key ID 907CE30E)
gpg: encrypted with 2048-bit RSA key, ID 26F7F452, created 2013-06-20
"De-Yu Wang (rhcx) <dywang7@gamil.com>"
abc123