I followed encrypted netrc file with gpg tutorial. I edited my
~/.profile
like this
if test -f $HOME/.gpg-agent-info && \
kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null; then
GPG_AGENT_INFO=`cat $HOME/.gpg-agent-info | cut -c 16-`
else
# No, gpg-agent not available; start gpg-agent
eval `gpg-agent --daemon --no-grab --write-env-file $HOME/.gpg-agent-info`
fi
export GPG_TTY=`tty`
export GPG_AGENT_INFO
This is ls
for ./gnupg
~/.gnupg$ ls
openpgp-revocs.d private-keys-v1.d pubring.kbx pubring.kbx~ random_seed trustdb.gpg
It does not work,when I restart my Ubuntu error pops up that I already have one gpg-agent running. How to check this and fix this?
eval `gpg-agent --daemon --no-grab $HOME/.gpg-agent-info`
gpg-agent: a gpg-agent is already running - not starting a new one
That tutorial is obsolete, and all you should add to your ~/.profile
now is GPG_TTY=$(tty)
.
On a modern Ubuntu system, the GPG agent sockets are in /run/user/$UID/gnupg
and systemd will start gpg-agent
for you automatically when gpg
runs and tries to access the agent socket.
To confirm this, gpgconf --list-dirs agent-socket
will show you the path that it's using for the socket, and systemctl --user status gpg-agent
should show the status of the already-running agent.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments