LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 06-05-2012, 11:54 AM   #1
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Rep: Reputation: 30
redhat 6 gpg2 none gui encryption


Hi

I seem to have a problem encrypting a simple text file using gpg2 on rhel6. It seems I am unable to do a simple --symmetric encryption in a none gui way where only a passphrase is required to encrypt/decrypt. It used to work on rhel5 but doesn't work on rhel6. Example below:

[root@server1 ~]# ls -l `which gpg`
lrwxrwxrwx. 1 root root 4 Feb 2 09:20 /usr/bin/gpg -> gpg2

[root@server1 ~]# gpg -c junk
can't connect to `/root/.gnupg/S.gpg-agent': Connection refused
xprop: unable to open display 'localhost:10.0'
pinentry-qt: cannot connect to X server localhost:10.0
gpg-agent[30680]: can't connect server: ec=4.16383
gpg-agent[30680]: can't connect to the PIN entry module: End of file
gpg-agent[30680]: command get_passphrase failed: No pinentry
gpg: problem with the agent: No pinentry
gpg: error creating passphrase: Operation cancelled
gpg: symmetric encryption of `junk' failed: Operation cancelled

[root@server1 ~]# ps -ef|grep gpg-agent
root 20911 1 0 Jun04 ? 00:00:00 gpg-agent --daemon
root 30687 30311 0 12:52 pts/0 00:00:00 grep gpg-agent


It looks like its trying to launch a GUI to enter a passphrase but I dont want that. I want to enter it at the command prompt. Anyone seen this behavior before? Any resolution?
 
Old 06-14-2012, 09:13 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Have a read of this https://bugzilla.redhat.com/show_bug.cgi?id=574406, but in short it looks like there should be 2 versions; gpg2 that expects a GUI and the old gpg.
See also the man page that mentions this; http://linux.die.net/man/1/gpg

It looks like null-ing env vars like DISPLAY may help..

I've had a quick look at RHEL6 repo and can only find gpg2 ...
Best if you phone RH and ask I reckon (after having read the bugzilla for background info) & please(!) post the soln.

I'm sure there's lots of us who would like to know.
 
Old 06-15-2012, 10:56 AM   #3
Xris718
Member
 
Registered: May 2003
Location: NYC
Distribution: CentOS
Posts: 261

Original Poster
Rep: Reputation: 30
Actually this is the solution which I found to work for me.

On RedHat-6 only

# yum install pinentry-gt
# vi /usr/bin/pinentry

Add below 3 lines to beginning of /usr/bin/pinentry file:

export PINENTRY_BINARY="/usr/bin/pinentry-curses"
exec $PINENTRY_BINARY "$@"
exit 1

Hope this helps.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] gpg2 caches passphrase in OpenSuSE 11.4 jtwdyp SUSE / openSUSE 3 09-19-2011 02:59 AM
installed gpg2 on suse10, how to package it and install on other suse box? 2007fld SUSE / openSUSE 1 11-24-2010 06:59 AM
GUI for setting up WPA encryption? roystonlodge Linux - Networking 2 06-10-2008 09:20 AM
GUI Encryption Progam mariah Linux - Software 1 07-26-2007 01:33 PM
WEP Encryption in RedHat 9 with DLINK 520+ dhailey13 Linux - Wireless Networking 1 08-16-2003 10:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration