My goal is to make commit on a remote server.
The problem is when I tried to $ git commit -m "test". It throws error
mini-mini-01:~/test$ git commit -m "a"
error: gpg failed to sign the data
fatal: failed to write commit object
Also I tried $ echo '' | gpg --clearsign. It throws error
echo '' | gpg --clearsign
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
gpg: signing failed: Inappropriate ioctl for device
gpg: [stdin]: clear-sign failed: Inappropriate ioctl for device
What I've did:
- forward the ssh agent, I can commit and push without an issue. However, in GitHub.com it is shown as Unverified.
~/.ssh/config
Host mini-01.local
ForwardAgent yes
ForwardX11 yes
ForwardX11Trusted yes
RemoteForward /run/user/1000/gnupg/S.gpg-agent /Users/jason/.gnupg/S.gpg-agent
Follow this guide https://superuser.com/a/1329299, including copying
pubring.pbxto the remote server.update git config
$ git config user.email <my email from github>
$ git config user.signingkey <the key from gpg --list-keys --keyid-format LONG>
$ git config commit.gpgsign true
What I've checked:
gpg --list-keysin remote server
mini-01@mini-01:~/test$ gpg --list-keys --keyid-format SHORT
/home/mini-01/.gnupg/pubring.kbx
----------------------------------
pub secret/secret 2023-02-27 [SC] [expires: 2024-02-27]
secret
uid [ultimate] secret <secret>
sub secret/secret 2023-02-27 [E] [expires: 2024-02-27]