왜 gpg가 화를 내고 중지합니까? 때마다 다음 경고

최근에 한 우분투 설치에서 다른 설치로 마이그레이션했으며 그 과정에서 내 사용자 이름이 변경되었습니다. 공개 / 개인 키 쌍을 gpg로 가져 왔으며 해독 (개인 키 사용)은 정상적으로 작동하지만 공개 키로 무언가를 암호화하려고 할 때마다 다음 경고 메시지가 표시됩니다.

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.

그 후 실제로 키를 사용할 것인지 묻는 메시지가 표시됩니다 (실제로 키 링 의 유일한 키이고 키의 출처를 알기 때문에 항상 “예”라고 대답합니다 ). 나는 물건을 잘 해독 할 수 있으므로 gpg가 무언가를 암호화하려고 할 때 왜 히스 티를 던지는가? 이 메시지가 다시 나타나지 않게하려면 어떻게해야합니까?



답변

나는 당신이 겪고있는 문제를 재현했습니다. 나는 다음과 같이했다 :

$ gpg --no-default-keyring --keyring ./test-keyring  --secret-keyring ./test-secring --trustdb-name ./test-trustdb --no-random-seed-file --gen-key

<specified parameters and let it do its thing>

gpg: key 58018BFE marked as ultimately trusted
public and secret key created and signed.

<snip>

$

이 프로세스는 키를 “궁극적으로 신뢰할 수있는”것으로 표시했습니다.

이제 키를 내 보냅니다.

$gpg --no-default-keyring --keyring ./test-keyring  --secret-keyring ./test-secring --trustdb-name ./test-trustdb --no-random-seed-file --export-secret-keys -a >private.key

$gpg --no-default-keyring --keyring ./test-keyring  --secret-keyring ./test-secring --trustdb-name ./test-trustdb --no-random-seed-file --export -a > public.key

이제 새로운 gpg 데이터베이스로 가져옵니다.

$gpg --no-default-keyring --keyring ./test2-keyring  --secret-keyring ./test2-secring --trustdb-name ./test2-trustdb --no-random-seed-file --import public.key

$gpg --no-default-keyring --keyring ./test2-keyring  --secret-keyring ./test2-secring --trustdb-name ./test2-trustdb --no-random-seed-file --import private.key

이제 새로운 열쇠 고리를 사용하여 암호화하려고하면 다음과 같은 결과가 나타납니다.

$ gpg --no-default-keyring --keyring ./test2-keyring  --secret-keyring ./test2-secring --trustdb-name ./test2-trustdb --no-random-seed-file -r Fake -e
gpg: AE3034E1: There is no assurance this key belongs to the named user

pub  1024R/AE3034E1 2013-06-13 Fake User <fake@example.com>
 Primary key fingerprint: AD4D BAFB 3960 6F9D 47C1  23BE B2E1 67A6 5801 8BFE
      Subkey fingerprint: 58F2 3669 B8BD 1DFC 8B12  096F 5D19 AB91 AE30 34E1

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.

그 이유는 “신뢰의 웹”모델입니다. 공개 키를 신뢰할 수 있으려면 기본적으로 1 개의 “최종”신뢰 인증서 (일반적으로 관련 사용자의 신원을 직접 확인한 경우) 또는 3 개의 “최소”신뢰 인증서 (아는 사람, 당신이 알고있는 누군가를 알고있는 사람은 … 인증서에 서명했습니다).

gpg는 보안 응용 프로그램이므로 신뢰할 수없는 것으로 나열되지 않은 키로 암호화하려고하면 경고합니다. 이 경우 자신의 키를 신뢰할 수없는 이유는 간단합니다. 이전 gpg 인스턴스에서 트러스트 관계를 내 보내지 않았기 때문입니다. 이렇게하려면 –export-ownertrust 및 –import-ownertrust 명령을 사용하십시오.

항상 그렇듯이 맨 페이지를 참조하십시오 .


답변

나는 같은 문제에 부딪 쳤지 만 더 이상 이전 키에 액세스 할 수 없었습니다. 따라서 다음을 사용하여 이전 키에 대한 신뢰를 다시 만들 수 있습니다.

gpg --edit-key YOUR@KEY.ID
gpg> trust
Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

  1 = I don't know or won't say
  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/N) y

답변

--always-trust플래그를 사용 하여이 메시지를 건너 뛸 수 있습니다 .