GPG設定を自宅から会社のコンピュータに転送しようとしています。これがキーをエクスポートする方法です。
sms@home-sms:~/Public$ gpg --list-keys
/home/sms/.gnupg/pubring.kbx
----------------------------
pub rsa3072 2023-07-17 [SC]
56D61B8B83BD3E534477DE20061D81ADCE33F311
uid [ultimate] Szymon M. Sabat <[email protected]>
sub rsa3072 2023-07-17 [E]
sms@home-sms:~/Public$ gpg --list-secret-keys
/home/sms/.gnupg/pubring.kbx
----------------------------
sec rsa3072 2023-07-17 [SC]
56D61B8B83BD3E534477DE20061D81ADCE33F311
uid [ultimate] Szymon M. Sabat <[email protected]>
ssb rsa3072 2023-07-17 [E]
sms@home-sms:~/Public$ gpg -a --export >pub.asc
sms@home-sms:~/Public$ cat pub.asc
-----BEGIN PGP PUBLIC KEY BLOCK-----
[key]
-----END PGP PUBLIC KEY BLOCK-----
sms@home-sms:~/Public$ gpg -a --export-secret-keys >sec.asc
sms@home-sms:~/Public$ cat sec.asc
-----BEGIN PGP PRIVATE KEY BLOCK-----
[key]
-----END PGP PRIVATE KEY BLOCK-----
sms@home-sms:~/Public$ ls
pub.asc sec.asc
その後、asc
ファイルを別のコンピュータにコピーしてキーをインポートすると(公開キーのインポートに問題ありません)、エラーが発生しました。
sms@ubudev-sms:~/Admin$ gpg --list-keys
gpg: directory '/home/sms/.gnupg' created
gpg: keybox '/home/sms/.gnupg/pubring.kbx' created
gpg: /home/sms/.gnupg/trustdb.gpg: trustdb created
sms@ubudev-sms:~/Admin$ gpg --list-secret-keys
sms@ubudev-sms:~/Admin$ ls
packages.microsoft.gpg pub.asc sec.asc
sms@ubudev-sms:~/Admin$ gpg --import pub.asc
gpg: key 061D81ADCE33F311: public key "Szymon M. Sabat <[email protected]>" imported
gpg: Total number processed: 1
gpg: imported: 1
sms@ubudev-sms:~/Admin$ gpg --import sec.asc
gpg: key 061D81ADCE33F311: "Szymon M. Sabat <[email protected]>" not changed
gpg: key 061D81ADCE33F311/061D81ADCE33F311: error sending to agent: No such file or directory
gpg: error building skey array: No such file or directory
gpg: error reading 'sec.asc': No such file or directory
gpg: import from 'sec.asc' failed: No such file or directory
gpg: Total number processed: 0
gpg: unchanged: 1
gpg: secret keys read: 1
説明が簡単に見えますが、私が何を間違っているのでしょうか?