gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent
I am having trouble with gpg & gpg-agent. I ran
Code:
gpg --gen-key Quote:
Thanks, jrtayloriv |
Have you tried creating the directory /root/.gnupg using mkdir (and possibly the S.gpg-agent file within it with touch)? The directory permissions should be 0700. Can you post the output of re-running the command once you've done that?
|
I did as you suggested. Now it just says:
Quote:
|
I use GPG, bit not the agent. It turns out that S.gpg-agent is a socket (not a file which is what the touch command creates). The gpg-agent listens to gpg, intercepts requests for passphrases and supplies the info so you don't have to type your passphrase all the time.
How is gpg-agent started on your box? It looks like it's running since it's what generated the error. However, it also looks like it can't reference the required socket. Is there a file in /tmp that looks anything like S.gpg-agent? Therre's some info at https://bugs.g10code.com/gnupg/issue859 which may be related. I'd also recommend the info at http://www.gentoo.org/doc/en/gnupg-user.xml and http://www.linuxcertif.com/man/1/gpg-agent/ |
Way of starting gpg-agent...
First recommend to use the saint
]$ man gpg-agent Read it. You will learn that gpg-agent should be started rather as daemon and only as a single pid. If you start looking the daemon start-up procedure inside your system of course, you won't find it (I didn't and it was Fedora 10). Well, First what I decided to do was to fallow the manual, so I did: Code:
]$ vi $HOME/.bashrc Code:
# GPG-AGENT stuff Code:
#!/bin/bash If anyone know it please write it down... Regards... |
SOLVED: S.gpg-agent issue w/simple commands
Quote:
Just do this: Code:
# presumably you already have a .gnupg directory, but this won't hurt even if you do |
.gnupg/S.gpg-agent - No such file or directory
The man page writeup for gpg-agent is pretty good, succinct, addresses the problem and provides a solution:
~~~~~~~~~~~~~~~~~~~ $> man gpg-agent #a daemon to manage secret (private) keys independently # from any protocol. It is used as a backend for gpg and gpgsm as well # as for a couple of other utilities. #Get the necessary information from gpg-agent gpg-agent --daemon --enable-ssh-support --write-env-file "${HOME}/.gpg-agent-info" #Create the necessary environment variables if [ -f "${HOME}/.gpg-agent-info" ]; then . "${HOME}/.gpg-agent-info" export GPG_AGENT_INFO export SSH_AUTH_SOCK export SSH_AGENT_PID fi ~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
Gpg agent Connectitity -- not reachable
I have the same problem and I've tried everything suggested above. Kleopatra Self-test results show all test pass except Gpg-Agent Connectivity. Slackware64 14.1
|
found the answer!
type this (or add it to your .bashrc):
export GPG_TTY=/dev/tty then you can use your gpg commands |
I ran into the issues last week on my RHEL6 running gnupg2. I had not had the issue running on the RHEL5 server that had been replaced by that. My PuTTY into the servers is launched from an MS Windows laptop and has X11 forwarding enabled.
My command line in the past was: Code:
gpg --passphrase "<PASSPHRASE>" -o "<DECRYPTED OUTPUT FILENAME>" --decrypt "<ENCRYPTED INPUT FILENAME>" After getting the error and seeing multiple hits in web searches regarding the error including this link I solved the issue. Posting findings in hopes they help others: 1) On my MS Windows laptop I started an X emulator (Exceed in my case but would expect same from others such as Cygwin/X). With the X11 forwarding on in the PuTTY shell running the above command line gave me an X Window popup on my MS Windows workstation to enter the passphrase. On entering the passphrase I still got a message in PuTTY session but it successfully decrypted. 2) Running "export GPG_TTY=$*tty)" and "unset DISPLAY" in my PuTTY session then running the above command line gave me the Text box to enter the passphrase on RHEL6 as it had previously on RHEL5. On entering the passphrase I still got a message in PuTTY session but it successfully decrypted. 3) Further review showed that in my scripts when using "--passphrase" I was also using "--batch". It turned out it was the lack of the "--batch" that was making it prompt for passphrase. Therefore I amended my command line to: Code:
gpg --batch --passphrase "<PASSPHRASE>" -o "<DECRYPTED OUTPUT FILENAME>" --decrypt "<ENCRYPTED INPUT FILENAME>" Summarizing: All 3 methods above work but when doing it via command line there is no reason not to issue "--batch" unless you want it to prompt you for the passphrase. |
All times are GMT -5. The time now is 03:49 PM. |