LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-27-2024, 02:33 AM   #1
dogemeister
LQ Newbie
 
Registered: Mar 2024
Distribution: Slackware
Posts: 5

Rep: Reputation: 2
Question Signing outgoing emails using GPG in mutt: "Permission Denied?"


I'm having the timiest of times getting the mutt email client to sign outgoing emails with my GPG key. Here's my .muttrc currently, as suggested here:

Code:
set crypt_use_gpgme=yes
set postpone_encrypt = yes
set pgp_self_encrypt = yes
set crypt_use_pka = no
set crypt_autosign = no
set crypt_autoencrypt = no
set crypt_autopgp = yes
set pgp_sign_as=0xblahblahblah
Eventually I'd like to have autosign on, but for now I hit 'p', then 's' to sign with the key specified above. I keep getting the following error after hitting 'y' to send:

Code:
error signing data: Permission denied?
Google gives me nothing when I quote this message.

I've got gpg-agent and pinentry installed. Working in an ssh session (not trying to tunnel or anything like that). Running mutt as root. Root attained via "su -" from a standard user. No X server running. I've tried several things:

environment variables
  • export GPG_TTY=$(tty)
  • export GPG_AGENT_INFO=~/.gnupg/S.gpg-agent
.gnupg/gpg-agent.conf options (of varying combinations):
  • pinentry-program /usr/bin/pinentry
  • allow-loopback-pinentry
  • use-standard-socket
  • enable-ssh-support

My best hunch at the moment is some permissions quirk of using "su -", but that's just where I'm at now. I've tried running mutt as a regular user (with its own generated GPG key) to no avail, still the same "Permission denied?" message after trying to send. Makes me worried it could be some missing package. Could use some help on this one!
 
Old 04-27-2024, 05:17 AM   #2
BrunoLafleur
Member
 
Registered: Apr 2020
Location: France
Distribution: Slackware
Posts: 402

Rep: Reputation: 367Reputation: 367Reputation: 367Reputation: 367
It seems that doing su in a user ssh session will throw an error with gpg.

Some explanation and a remedy if you do want to work with su (is beeing root really necessary for your task ?) :

https://askubuntu.com/questions/1080...mission-denied
 
3 members found this post helpful.
Old 04-27-2024, 09:13 AM   #3
dogemeister
LQ Newbie
 
Registered: Mar 2024
Distribution: Slackware
Posts: 5

Original Poster
Rep: Reputation: 2
Thanks for mentioning that. I thought I had already accounted for that by using the same .muttrc with a user with lesser privileges. However, that user was *not* the same as the one I ssh'd to, and I had used 'su -' already. To clarify, the following did not work:

Code:
me@elsewhere:~$ ssh usera@place
usera@place:~$ su - root
root@place:~$ *fail to sign mutt email*

me@elsewhere:~$ ssh usera@place
usera@place:~$ su - root
root@place:~$ su - userb
userb@place:~$ *fail to sign mutt email*

me@elsewhere:~$ ssh usera@place
usera@place:~$ su - userb
userb@place:~$ *fail to sign mutt email*
What did work:
Code:
me@elsewhere:~$ ssh usera@place
usera@place:~$ *successfully sign and send mutt email*
So I could just add userb to my AllowUsers in sshd_config. However, I did figure out what my problem was with using 'su -' beforehand. Had to do with the tty ownership remaining with the initial user usera before 'su -' was invoked.

Code:
userb@place:~$ ls -lh $(tty)
crw--w---- 1 usera tty 136, 2 Apr 27 17:09 /dev/pts/2
So long as the active user owned the tty it was using, mutt had no problem signing the email.
 
1 members found this post helpful.
Old 04-30-2024, 07:49 AM   #4
SlackCoder
Member
 
Registered: Nov 2020
Posts: 44

Rep: Reputation: Disabled
My bet is it is an environment variable issue, try 'su --login ..' or 'sudo --login ..', and check GNUPGHOME is set correctly.

Last edited by SlackCoder; 04-30-2024 at 07:53 AM.
 
  


Reply

Tags
gpg, gpg-agent, mutt, muttrc



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
gpg / gpg-agent -- Can't connect to /root/.gnupg/S.gpg-agent jrtayloriv Linux - Security 9 06-03-2019 10:06 AM
DKIM signing using OpenDKIM not signing all emails Matt Penfold Linux - Server 0 05-13-2018 08:45 PM
GPG issues - gpg: signing failed: Permission denied ilesterg Linux - Software 3 02-07-2017 08:19 AM
Signing outgoing emails with both DKIM/DomainKeys Mailnet Linux - General 0 02-05-2015 11:44 AM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:00 AM.

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