LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-25-2012, 11:21 AM   #1
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Rep: Reputation: 3
Unable to generate GPG key, command get_passphrase failed: Operation cancelled


Hello,

I like to improve my security, however, I have no background experience with GPG. I am following http://www.gnupg.org/gph/en/manual/c14.html documentation to the letter, however, what I'm reading is not the expected behavior I'm getting, IE:

Code:
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? O
You need a Passphrase to protect your secret key.

gpg-agent[28772]: command get_passphrase failed: Operation cancelled
gpg: cancelled by user
gpg: Key generation canceled.
I've already google'd this error but all the issues and/or solutions have nothing pertaining to my problem. So I am stuck.... I'm not sure what I'm suppose to being doing now, create a passphrase? How do I create passphrase if I don't a private key to begin with?
 
Old 03-25-2012, 03:25 PM   #2
manu-tm
Member
 
Registered: May 2008
Location: France
Distribution: Ubuntu, Debian
Posts: 343

Rep: Reputation: 43
Did you provide a passphrase?
 
Old 03-25-2012, 05:56 PM   #3
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Original Poster
Rep: Reputation: 3
Hello,


It didn't ask for one which is puzzling :/
 
Old 03-25-2012, 06:00 PM   #4
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Original Poster
Rep: Reputation: 3
Hello,

I did a strace as I'm unfamiliar how to force GPG to be more verbose:

Code:
ioctl(3, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
rt_sigaction(SIGWINCH, {SIG_DFL, [], SA_RESTORER, 0x7f9c3600cb30}, {0x7f9c369fefb0, [], SA_RESTORER|SA_RESTART, 0x7f9c3600cb30}, 8) = 0
write(3, "You need a Passphrase to protect"..., 51You need a Passphrase to protect your secret key.

) = 51
getpid()                                = 7627
open("/root/.gnupg/random_seed", O_RDONLY) = 4
fcntl(4, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}) = 0
fstat(4, {st_mode=S_IFREG|0600, st_size=600, ...}) = 0
read(4, "X\250\33#\242*\352$\210\203\235\3131u\201\243\31\27\341Ku\5\317\357\312\361\330\376x\307f\356"..., 600) = 600
close(4)                                = 0
times({tms_utime=0, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 473020843
open("/dev/urandom", O_RDONLY)          = 4
fcntl(4, F_GETFD)                       = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
select(5, [4], NULL, NULL, {3, 0})      = 1 (in [4], left {2, 999998})
read(4, "\376\4I\223\250\273\366\355\274%\275\275\344\316\270\34", 16) = 16
getrusage(RUSAGE_SELF, {ru_utime={0, 999}, ru_stime={0, 26995}, ...}) = 0
times({tms_utime=0, tms_stime=2, tms_cutime=0, tms_cstime=0}) = 473020843
socket(PF_FILE, SOCK_STREAM, 0)         = 5
connect(5, {sa_family=AF_FILE, path="/root/.gnupg/S.gpg-agent"}, 26) = -1 ENOENT (No such file or directory)
close(5)                                = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f9c3746a9d0) = 7629
wait4(7629, [{WIFEXITED(s) && WEXITSTATUS(s) == 1}], 0, NULL) = 7629
--- SIGCHLD (Child exited) @ 0 (0) ---
rt_sigaction(SIGPIPE, NULL, {SIG_IGN, [], SA_RESTORER, 0x7f9c3600cb30}, 8) = 0
pipe([5, 6])                            = 0
pipe([7, 8])                            = 0
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f9c3746a9d0) = 7630
close(6)                                = 0
close(7)                                = 0
read(5, "OK Pleased to meet you, process "..., 1002) = 36
read(5, "\n", 966)                      = 1
write(8, "RESET", 5)                    = 5
write(8, "\n", 1)                       = 1
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "OPTION ttyname=/dev/pts/7", 25) = 25
write(8, "\n", 1)                       = 1
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "OPTION ttytype=screen", 21)   = 21
write(8, "\n", 1)                       = 1
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "OPTION lc-ctype=en_US.UTF-8", 27) = 27
write(8, "\n", 1)                       = 1
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "OPTION lc-messages=C", 20)    = 20
write(8, "\n", 1)                       = 1
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "OPTION allow-pinentry-notify", 28) = 28
write(8, "\n", 1)                       = 1
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "GETINFO s2k_count", 17)       = 17
write(8, "\n", 1)                       = 1
read(5, "D 5242880\n", 1002)            = 10
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "GETINFO cmd_has_option GET_PASSP"..., 44) = 44
write(8, "\n", 1)                       = 1
read(5, "OK", 1002)                     = 2
read(5, "\n", 1000)                     = 1
write(8, "GET_PASSPHRASE --data --repeat=1"..., 82) = 82
write(8, "\n", 1)                       = 1
read(5, "INQUIRE PINENTRY_LAUNCHED 7631\n", 1002) = 31
write(8, "END", 3)                      = 3
write(8, "\n", 1)                       = 1
read(5, gpg-agent[7630]: command get_passphrase failed: Operation cancelled
"ERR 83886179 Operation cancelled"..., 1002) = 44
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f9c37420000
write(2, "gpg: cancelled by user\n", 23gpg: cancelled by user
) = 23
write(2, "gpg: Key generation canceled.\n", 30gpg: Key generation canceled.
) = 30
open("/root/.gnupg/random_seed", O_WRONLY|O_CREAT, 0600) = 6
fcntl(6, F_SETLK, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}) = 0
ftruncate(6, 0)                         = 0
write(6, "\220V\357s>h@\21\265\242\"w\10~\323\251\0\31z!\22q\271\206m\3216\f\325>\312\4"..., 600) = 600
close(6)                                = 0
munmap(0x7f9c37422000, 32768)           = 0
exit_group(2)                           = ?
 
Old 03-25-2012, 09:24 PM   #5
manu-tm
Member
 
Registered: May 2008
Location: France
Distribution: Ubuntu, Debian
Posts: 343

Rep: Reputation: 43
Use -v for verbose output.

How is it that you use /root/.gnupg/random_seed? On my box, it's in my home dir.
 
Old 03-26-2012, 07:00 AM   #6
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Original Poster
Rep: Reputation: 3
Hello,


I ran the command as root, assuming it matter? I'll try as normal user.
 
Old 03-26-2012, 07:04 AM   #7
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Original Poster
Rep: Reputation: 3
Hello,

May I ask, what is the purpose of /root/.gnupg/random_seed?
 
Old 03-26-2012, 07:17 AM   #8
manu-tm
Member
 
Registered: May 2008
Location: France
Distribution: Ubuntu, Debian
Posts: 343

Rep: Reputation: 43
Yes, just run gnupg as a normal user (the problem was probably no write permission for the root folder.)

About ./gnupg/random_seed, see: http://www.gnupg.org/documentation/m...iguration.html
 
Old 03-26-2012, 07:38 AM   #9
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Original Poster
Rep: Reputation: 3
Hello,

Thanks for you help, I was able to create the keys as normal user.

Best Regards
 
Old 03-26-2012, 07:40 AM   #10
manu-tm
Member
 
Registered: May 2008
Location: France
Distribution: Ubuntu, Debian
Posts: 343

Rep: Reputation: 43
No prob
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Transaction error while updating my fedora 15-GPG key retrieval failed pradeeprajkumar Fedora 2 05-28-2011 11:21 PM
gpg: decryption failed: secret key not available edhe1 Linux - Security 4 03-08-2011 06:07 PM
GPG key retrieval failed, CentOS 5.1 triley Linux - General 3 12-01-2009 06:39 PM
GPG: Bad session key gpg between gpg on linux and gpg gui on windows XP konqi Linux - Software 1 07-21-2009 09:37 AM
public.gpg.key: import read failed error ynbfung Linux - Software 2 05-02-2006 01:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration