
새로 설치된 우분투 서버에 PGP 키 쌍을 복사했습니다. 하지만 작동하지 않습니다. 파일을 해독하려고 할 때 "작업이 취소되었습니다"라는 오류가 발생합니다.
$ echo TEST | gpg -e -a -r [email protected] > test.gpg
$ gpg -d < test.gpg
gpg: encrypted with 1024-bit ELG key, ID CBABC188BB23CD11, created 2003-05-22
"Emanuele Paolini <[email protected]>"
gpg: public key decryption failed: Operation cancelled
gpg: decryption failed: No secret key
$ gpg --list-secret-keys
/home/paolini/.gnupg/pubring.gpg
--------------------------------
sec dsa1024 2003-05-22 [SC]
848EA2CE420E06FF22E88DED7F0D73E98288DA05
uid [ultimate] Emanuele Paolini <[email protected]>
uid [ultimate] Emanuele Paolini <[email protected]>
uid [ultimate] Emanuele Paolini <[email protected]>
uid [ultimate] Emanuele Paolini <[email protected]>
uid [ultimate] Emanuele Paolini <[email protected]>
ssb elg1024 2003-05-22 [E]
동일한 명령이 내 개인용 컴퓨터에서도 잘 작동합니다.
- 어쩌면 키를 복사하는 데 문제가 있었나요?
- 아마도 SSH 연결에 문제가 있는 것일까요?
업데이트 문제는 SSH 연결과 관련이 있습니다. 실제로 서버 콘솔에서 명령을 시도하면 올바르게 작동합니다(비밀번호를 묻는 창이 열립니다). 따라서 pinentry와 관련이 있습니다. 내 SSH 연결에는 X가 활성화되어 작동 중이었습니다.
업데이트 2
@Olivier가 제안한대로 pinentry 대안을 변경해 보았습니다. pinentry-gnome3
(기본값)과 pinentry-cursers
. 중에서만 선택할 수 있습니다 . 후자를 선택했는데 불행하게도 "장치에 부적절한 ioctl" 오류가 발생했습니다...
답변1
해결책:
sudo update-alternatives --config pinentry
pinentry-curses
또는 대안을 선택합니다 pinentry-tty
.