Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

gpg: cannot open `/dev/tty': No such device or address

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

gpg: cannot open `/dev/tty': No such device or address

  • Quote

Post by charles17 » Mon Jan 18, 2016 4:51 pm

Could someone help with this? I came across from the Pulling validated Gentoo ebuild tree snapshots of the handbook.

When I do
$ su -c "gpg --homedir /var/lib/gentoo/gkeys/keyrings/gentoo/release --edit-key 0xF6CD6C97 check"
it tells me
Password:
gpg: WARNING: unsafe permissions on homedir `/var/lib/gentoo/gkeys/keyrings/gentoo/release'
gpg (GnuPG) 2.0.28; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: cannot open `/dev/tty': No such device or address
Searching the internet for this message I could not find a solution.
Any idea? What's the problem with gnupg and /dev/tty?
Top
Princess Nell
l33t
l33t
User avatar
Posts: 947
Joined: Fri Apr 15, 2005 1:00 pm

  • Quote

Post by Princess Nell » Mon Jan 18, 2016 10:18 pm

The warning indicates the permissions of the "homedir" are wrong - they probably need to be 0700.

edit-key is by nature an interactive command, but you're not running interactively. Try --no-tty.
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Tue Jan 19, 2016 11:59 am

Thanks Princess Nell for your answer.
Changed the permission to 700. But when I try with --no-tty
su -c "gpg --no-tty --homedir /var/lib/gentoo/gkeys/keyrings/gentoo/release --edit-key 0xF6CD6C97 check"
It would end up with
Password:
gpg (GnuPG) 2.0.28; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

gpg: Sorry, no terminal at all requested - can't get input
That also doesn't look very promising.

But when I try it as root it works
root # gpg --homedir /var/lib/gentoo/gkeys/keyrings/gentoo/release/ --edit-key F6CD6C97 trust
gpg: WARNING: unsafe ownership on homedir `/var/lib/gentoo/gkeys/keyrings/gentoo/release/'
gpg (GnuPG) 2.0.28; Copyright (C) 2015 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


pub 4096R/F6CD6C97 created: 2014-10-03 expires: 2017-09-17 usage: C
trust: full validity: unknown
sub 4096R/151C3FC7 created: 2014-10-03 expires: 2017-09-17 usage: S
[ unknown] (1). Gentoo-keys Team <gkeys@gentoo.org>

pub 4096R/F6CD6C97 created: 2014-10-03 expires: 2017-09-17 usage: C
trust: full validity: unknown
sub 4096R/151C3FC7 created: 2014-10-03 expires: 2017-09-17 usage: S
[ unknown] (1). Gentoo-keys Team <gkeys@gentoo.org>

Please decide how far you trust this user to correctly verify other users' keys
(by looking at passports, checking fingerprints from different sources, etc.)

1 = I don't know or won't say
2 = I do NOT trust
3 = I trust marginally
4 = I trust fully
5 = I trust ultimately
m = back to the main menu

Your decision?
Why can't I do that from normal user with su -c?
Top
Princess Nell
l33t
l33t
User avatar
Posts: 947
Joined: Fri Apr 15, 2005 1:00 pm

  • Quote

Post by Princess Nell » Tue Jan 19, 2016 10:16 pm

Use --batch, not --no-tty. And update those permissions :)
Top
charles17
Advocate
Advocate
Posts: 3686
Joined: Sun Mar 02, 2008 3:20 pm

  • Quote

Post by charles17 » Wed Jan 20, 2016 8:25 am

Princess Nell wrote:Use --batch, not --no-tty. And update those permissions :)
Works for
$ su -c "gpg --batch --homedir /var/lib/gentoo/gkeys/keyrings/gentoo/release --edit-key 0xF6CD6C97 check"
But not for
$ su -c "gpg --batch --homedir /var/lib/gentoo/gkeys/keyrings/gentoo/release --edit-key 0xF6CD6C97 trust"
...
...
gpg: Sorry, we are in batchmode - can't get input
Seems that su -c "gpg ......." is not so recommended
Top
Princess Nell
l33t
l33t
User avatar
Posts: 947
Joined: Fri Apr 15, 2005 1:00 pm

  • Quote

Post by Princess Nell » Wed Jan 20, 2016 9:39 pm

The second command is incomplete and waiting for input, so not a candidate for --batch in this form.
Top
Post Reply

6 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic