هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
gpg manages a keyring of OpenPGP keys. In operations you use it mostly to verify downloads and package signatures (RPM repos, HashiCorp releases), to sign releases and Git tags, and sometimes to encrypt files for a person. RPM and DNF check package signatures with GPG keys imported by rpm --import.
طريقة الكتابة
gpg [OPTIONS] COMMAND [ARGS]الأجزاء الرئيسية
Commands
--full-generate-key/--quick-generate-key- Make a key pair.
--list-keys/--list-secret-keys- Show keys.
--importFILE/--export-aID- Import / export public keys.
--verifySIG[FILE]- Check a signature.
--detach-sign-aFILE- Make a separate signature file.
--clearsignFILE- Sign a text file in place.
-e-rIDFILE- Encrypt for a person.
-dFILE- Decrypt.
-cFILE- Encrypt with a passphrase (symmetric).
--fingerprintID- Show the fingerprint (compare it!).
--edit-keyID- Trust, expire, add sub-keys.
--gen-revokeID- Make a revocation certificate.
الخيارات 6
الأكثر استخدامًا
Flags
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Make a key
gpg --quick-generate-key "s0sta release signing" ed25519 sign 2y gpg --list-secret-keys --keyid-format long2Verify a download (HashiCorp example)
3Check the fingerprint of an imported key
gpg --import hashicorp.asc gpg --fingerprint security@hashicorp.com4Sign a release file
gpg --detach-sign -a shop-1.4.0.tar.gz gpg --verify shop-1.4.0.tar.gz.asc shop-1.4.0.tar.gz5Encrypt a file for a colleague
gpg --import colleague.asc gpg -e -a -r colleague@example.com handover.txt gpg -d handover.txt.asc6Encrypt with only a passphrase
gpg -c --cipher-algo AES256 notes.txt7Check RPM package signatures
8Sign Git tags with GPG
9Export your public key for GitHub
gpg --export -a 0x1234ABCD5678EF9010Make a revocation certificate (keep it offline)
gpg --gen-revoke 0x1234ABCD5678EF90 > revoke.asc
لا يوجد شيء يطابق هذا الفلتر.
انتبه
- Always compare fingerprints from a second trusted source; a key with the right name can be fake.
- Back up the secret key and the revocation certificate offline.
الملفات
~/.gnupg/- Keyring and settings.
نصائح للحفظ
- For new projects, SSH signing (Git) and age (files) are simpler; GPG is still needed for RPM and many downloads.
رموز الخروج
0 | Success (good signature). |
1 | Bad signature. |
2 | Other error. |