特殊:Badtitle/NS100:KMailGPGAgent:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
(未显示同一用户的4个中间版本) | |||
第1行: | 第1行: | ||
{{From|https://help.ubuntu.com/community/KMailGPGAgent}} | {{From|https://help.ubuntu.com/community/KMailGPGAgent}} | ||
{{Languages|UbuntuHelp:KMailGPGAgent}} | {{Languages|UbuntuHelp:KMailGPGAgent}} | ||
<<Include(Tag/Unsupported)>> | |||
<<Include(Tag/NeedsExpansion)>> | |||
== Introduction == | == Introduction == | ||
This guide assumes that you have a working knowledge of GnuPG and the command line, and that GPG and KMail are installed in a KDE environment. Detailed information on GnuPG can be found [ | This guide assumes that you have a working knowledge of GnuPG and the command line, and that GPG and KMail are installed in a KDE environment. Detailed information on GnuPG can be found [[UbuntuHelp:GnuPrivacyGuardHowto|here]].|More information on KMail can be found on [[UbuntuHelp:EmailClients|EmailClients]]. | ||
== Set up == | == Set up == | ||
=== Required Packages === | === Required Packages === | ||
第31行: | 第33行: | ||
=== Configuring KDE to start gpg-agent on login === | === Configuring KDE to start gpg-agent on login === | ||
In order to use the gpg-agent with KDE, you'll want it to start up and have its environment variables added to KDE's environment before KDE starts. Thankfully, KDE allows us to do this quite easily. | In order to use the gpg-agent with KDE, you'll want it to start up and have its environment variables added to KDE's environment before KDE starts. Thankfully, KDE allows us to do this quite easily. | ||
<ol><li>Create the directory <code><nowiki>~/.kde/env</nowiki></code> | |||
</li><li>Create a file in the directory called <code><nowiki>gpg-agent.sh</nowiki></code> with the following contents:</li></ol> | |||
<pre><nowiki> | <pre><nowiki> | ||
eval "$(gpg-agent --daemon)" | eval "$(gpg-agent --daemon)" | ||
</nowiki></pre> | </nowiki></pre> | ||
<ol><li>Make the file executable. | |||
</li><li>Log out of KDE if you're in KDE and log back in. | |||
</li><li>Create the directory <code><nowiki>~/.kde/shutdown</nowiki></code> | |||
</li><li>Create a file in the directory called <code><nowiki>gpg-agent.sh</nowiki></code> with the following contents:</li></ol> | |||
<pre><nowiki> | <pre><nowiki> | ||
#!/bin/sh | #!/bin/sh | ||
第47行: | 第51行: | ||
[[ -n ${GPG_AGENT_INFO} ]] && kill `echo $\{GPG_AGENT_INFO\} | cut -d ':' -f 2` | [[ -n ${GPG_AGENT_INFO} ]] && kill `echo $\{GPG_AGENT_INFO\} | cut -d ':' -f 2` | ||
</nowiki></pre> | </nowiki></pre> | ||
<ol><li>Make the file executable.</li></ol> | |||
Before proceeding, please test gpg-agent: | Before proceeding, please test gpg-agent: | ||
<pre><nowiki> | <pre><nowiki> | ||
第53行: | 第58行: | ||
</nowiki></pre> | </nowiki></pre> | ||
==== Configuring KMail ==== | ==== Configuring KMail ==== | ||
<ol><li>Start up KMail | |||
</li><li>Go to the Settings menu | |||
</li><li>Select the Security icon on the left hand side | |||
</li><li>Select the Crypto Backends tab | |||
</li><li>Make sure OpenPGP (gpg) is in the list, and check the box next to it. | |||
</li><li>Select the Identities Icon on the left hand side | |||
</li><li>If you haven't already created an identity for yourself, create one now. | |||
</li><li>Select your identity and click the Modify... button | |||
</li><li>Select the Cryptography tab</li></ol> | |||
10. Click on Change... next to OpenPGP signing key and select your preferred key from the list. | 10. Click on Change... next to OpenPGP signing key and select your preferred key from the list. | ||
11. Repeat for OpenPGP encryption key if you want to encrypt messages | 11. Repeat for OpenPGP encryption key if you want to encrypt messages | ||
第81行: | 第87行: | ||
Bottom line is that all of the steps above Configuring KMail should no longer be required for new Gutsy installs. | Bottom line is that all of the steps above Configuring KMail should no longer be required for new Gutsy installs. | ||
---- | ---- | ||
[[category: | [[category:CategoryEmail]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年11月17日 (二) 19:41的最新版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/KMailGPGAgent }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/af | • {{#if: UbuntuHelp:KMailGPGAgent|Afrikaans| [[::KMailGPGAgent/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ar | • {{#if: UbuntuHelp:KMailGPGAgent|العربية| [[::KMailGPGAgent/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/az | • {{#if: UbuntuHelp:KMailGPGAgent|azərbaycanca| [[::KMailGPGAgent/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/bcc | • {{#if: UbuntuHelp:KMailGPGAgent|جهلسری بلوچی| [[::KMailGPGAgent/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/bg | • {{#if: UbuntuHelp:KMailGPGAgent|български| [[::KMailGPGAgent/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/br | • {{#if: UbuntuHelp:KMailGPGAgent|brezhoneg| [[::KMailGPGAgent/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ca | • {{#if: UbuntuHelp:KMailGPGAgent|català| [[::KMailGPGAgent/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/cs | • {{#if: UbuntuHelp:KMailGPGAgent|čeština| [[::KMailGPGAgent/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/de | • {{#if: UbuntuHelp:KMailGPGAgent|Deutsch| [[::KMailGPGAgent/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/el | • {{#if: UbuntuHelp:KMailGPGAgent|Ελληνικά| [[::KMailGPGAgent/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/es | • {{#if: UbuntuHelp:KMailGPGAgent|español| [[::KMailGPGAgent/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/fa | • {{#if: UbuntuHelp:KMailGPGAgent|فارسی| [[::KMailGPGAgent/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/fi | • {{#if: UbuntuHelp:KMailGPGAgent|suomi| [[::KMailGPGAgent/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/fr | • {{#if: UbuntuHelp:KMailGPGAgent|français| [[::KMailGPGAgent/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/gu | • {{#if: UbuntuHelp:KMailGPGAgent|ગુજરાતી| [[::KMailGPGAgent/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/he | • {{#if: UbuntuHelp:KMailGPGAgent|עברית| [[::KMailGPGAgent/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/hu | • {{#if: UbuntuHelp:KMailGPGAgent|magyar| [[::KMailGPGAgent/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/id | • {{#if: UbuntuHelp:KMailGPGAgent|Bahasa Indonesia| [[::KMailGPGAgent/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/it | • {{#if: UbuntuHelp:KMailGPGAgent|italiano| [[::KMailGPGAgent/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ja | • {{#if: UbuntuHelp:KMailGPGAgent|日本語| [[::KMailGPGAgent/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ko | • {{#if: UbuntuHelp:KMailGPGAgent|한국어| [[::KMailGPGAgent/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ksh | • {{#if: UbuntuHelp:KMailGPGAgent|Ripoarisch| [[::KMailGPGAgent/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/mr | • {{#if: UbuntuHelp:KMailGPGAgent|मराठी| [[::KMailGPGAgent/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ms | • {{#if: UbuntuHelp:KMailGPGAgent|Bahasa Melayu| [[::KMailGPGAgent/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/nl | • {{#if: UbuntuHelp:KMailGPGAgent|Nederlands| [[::KMailGPGAgent/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/no | • {{#if: UbuntuHelp:KMailGPGAgent|norsk| [[::KMailGPGAgent/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/oc | • {{#if: UbuntuHelp:KMailGPGAgent|occitan| [[::KMailGPGAgent/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/pl | • {{#if: UbuntuHelp:KMailGPGAgent|polski| [[::KMailGPGAgent/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/pt | • {{#if: UbuntuHelp:KMailGPGAgent|português| [[::KMailGPGAgent/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ro | • {{#if: UbuntuHelp:KMailGPGAgent|română| [[::KMailGPGAgent/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/ru | • {{#if: UbuntuHelp:KMailGPGAgent|русский| [[::KMailGPGAgent/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/si | • {{#if: UbuntuHelp:KMailGPGAgent|සිංහල| [[::KMailGPGAgent/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/sq | • {{#if: UbuntuHelp:KMailGPGAgent|shqip| [[::KMailGPGAgent/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/sr | • {{#if: UbuntuHelp:KMailGPGAgent|српски / srpski| [[::KMailGPGAgent/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/sv | • {{#if: UbuntuHelp:KMailGPGAgent|svenska| [[::KMailGPGAgent/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/th | • {{#if: UbuntuHelp:KMailGPGAgent|ไทย| [[::KMailGPGAgent/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/tr | • {{#if: UbuntuHelp:KMailGPGAgent|Türkçe| [[::KMailGPGAgent/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/vi | • {{#if: UbuntuHelp:KMailGPGAgent|Tiếng Việt| [[::KMailGPGAgent/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/yue | • {{#if: UbuntuHelp:KMailGPGAgent|粵語| [[::KMailGPGAgent/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/zh | • {{#if: UbuntuHelp:KMailGPGAgent|中文| [[::KMailGPGAgent/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/zh-hans | • {{#if: UbuntuHelp:KMailGPGAgent|中文(简体)| [[::KMailGPGAgent/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:KMailGPGAgent | UbuntuHelp:KMailGPGAgent | {{#if: | :}}KMailGPGAgent}}/zh-hant | • {{#if: UbuntuHelp:KMailGPGAgent|中文(繁體)| [[::KMailGPGAgent/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:KMailGPGAgent|:KMailGPGAgent|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :KMailGPGAgent/zh | | {{#ifexist: KMailGPGAgent/zh | | {{#ifeq: {{#titleparts:KMailGPGAgent|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:KMailGPGAgent|1|-1|}} | zh | | }}
<<Include(Tag/Unsupported)>> <<Include(Tag/NeedsExpansion)>>
Introduction
This guide assumes that you have a working knowledge of GnuPG and the command line, and that GPG and KMail are installed in a KDE environment. Detailed information on GnuPG can be found here.|More information on KMail can be found on EmailClients.
Set up
Required Packages
Pinentry-Qt will provide the front end into which you will type your pass phrase.
pinentry-qt
gpg-agent is a program that caches your private key passphrases for a period of time. Without gpg-agent you'd have to type your passphrase every time you wanted to decrypt an email or file. Since it is recommended that your passphrase be very long, and hard to guess, this can become cumbersome.
gpg-agent
Configuring GPG
Uncomment the following line in ~/.gnupg/gpg.conf
. If not present, please append it to the file.
use-agent
Note: Due to a gnupg bug in Feisty, your ~/.gnupg/gpg.conf
may not have been created. You can create it by:
cp /usr/share/gnupg/options.skel ~/.gnupg/gpg.conf
Then create the file ~/.gnupg/gpg-agent.conf
with the following contents:
pinentry-program /usr/bin/pinentry-qt no-grab default-cache-ttl 1800
You can replace the time, 1800 seconds, for a greater period, but it must be inferior to two hours (7200). If you wish to store the passphrase for a longer period of time, you must substitute default-cache-ttl 1800
with the following block of text, where XXXX is the time in seconds. You should also remember that there is compromise between ease of use and security.
default-cache-ttl XXXX max-cache-ttl XXXX
Configuring KDE to start gpg-agent on login
In order to use the gpg-agent with KDE, you'll want it to start up and have its environment variables added to KDE's environment before KDE starts. Thankfully, KDE allows us to do this quite easily.
- Create the directory
~/.kde/env
- Create a file in the directory called
gpg-agent.sh
with the following contents:
eval "$(gpg-agent --daemon)"
- Make the file executable.
- Log out of KDE if you're in KDE and log back in.
- Create the directory
~/.kde/shutdown
- Create a file in the directory called
gpg-agent.sh
with the following contents:
#!/bin/sh # the second field of the GPG_AGENT_INFO variable is the # process ID of the gpg-agent active in the current session # so we'll just kill that, rather than all of them :) [[ -n ${GPG_AGENT_INFO} ]] && kill `echo $\{GPG_AGENT_INFO\} | cut -d ':' -f 2`
- Make the file executable.
Before proceeding, please test gpg-agent:
echo "test" | gpg -ase -r 0xE95EDDC9 | gpg
Configuring KMail
- Start up KMail
- Go to the Settings menu
- Select the Security icon on the left hand side
- Select the Crypto Backends tab
- Make sure OpenPGP (gpg) is in the list, and check the box next to it.
- Select the Identities Icon on the left hand side
- If you haven't already created an identity for yourself, create one now.
- Select your identity and click the Modify... button
- Select the Cryptography tab
10. Click on Change... next to OpenPGP signing key and select your preferred key from the list. 11. Repeat for OpenPGP encryption key if you want to encrypt messages 12. Make sure the Preferred crypto message format is either Any or OpenPGP/MIME. The inline format is deprecated, and highly annoying to users of mail client software that doesn't support this standard. This is the "old" way of doing things, and the OpenPGP/MIME format is the preferred method. 13. Click OK in the edit identity window and in the preferences window.
Using
Sending emails
When you compose an email, you will notice an icon depicting a fountain pen drawing a scribble. Click it to sign an email with your private key. The icon next to it depicts a lock and is used to encrypt an email using the recipient's public key.
Reading emails
KMail will automatically validate signatures on a received message. When you receive an encrypted message, you will be prompted to enter your pass phrase. If you have successfully done so, KMail will display the encrypted message.
Conclusion
Now you're successfully using KMail to send and receive signed and encrypted messages. Remember that the more people use tools like PGP and GnuPG, the safer the internet can become. You can sincerely tell someone you never sent an email they said you sent because it wasn't signed with your key, and you can send sensitive information safely between your peers with encrypted messages!
Note: If you create Ubuntu packages (no longer required with the Gutsy version of devscripts), please add the following line to ~/.devscripts
:
DEBUILD_PRESERVE_ENVVARS=DISPLAY
Gutsy Updates
As of gnupg 1.4.6-2ubuntu3 in Gutsy, new installations/users will automatically be configured for gpg to use-agent. Dependencies for KMail have also been adjusted to automatically install gnupg-agent and pinentry-qt. If you want a non-default cache period or you don't want the pinentry window to grab focus you can still make the ~/.gnupg/gpg-agent.conf
changes recommended above, but they are not required.
Bottom line is that all of the steps above Configuring KMail should no longer be required for new Gutsy installs.