Hi there, I also just had the same problem on an Ubuntu 16.04.3 LTS box (with both zsh and bash, on tty and on pseudo terminal running X). Is it already known where this error message comes from, so we could change the string to something more convenient recommending the user to become root or to run sudo?
Of course, as explained by ESR it would be nice if it was not even necessary to run the command as root, but (at least on my system) normal users have no permission to access the respective file descriptors. ls -l /dev/console crw------- 1 root root 5, 1 Aug 22 11:13 /dev/console ls -l /dev/tty0 crw--w---- 1 root tty 4, 0 Aug 22 11:13 /dev/tty0 strace tells me that showkey (run as user) does not have enough privileges: open("/dev/tty0", O_RDWR) = -1 EACCES (Permission denied) open("/dev/tty0", O_WRONLY) = -1 EACCES (Permission denied) open("/dev/tty0", O_RDONLY) = -1 EACCES (Permission denied) open("/dev/console", O_RDWR) = -1 EACCES (Permission denied) open("/dev/console", O_WRONLY) = -1 EACCES (Permission denied) open("/dev/console", O_RDONLY) = -1 EACCES (Permission denied) BTW: I am running the most recent kbd/showkey version that is available for Xenial. Maybe this bug has already been fixed upstream in version 2.0? apt-cache policy kbd kbd: Installed: 1.15.5-1ubuntu5 Candidate: 1.15.5-1ubuntu5 Version table: *** 1.15.5-1ubuntu5 500 500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages 100 /var/lib/dpkg/status 1.15.5-1ubuntu4 500 500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to kbd in Ubuntu. https://bugs.launchpad.net/bugs/1006676 Title: showkey fails with "Couldn't get a file descriptor referring to the console" Status in kbd package in Ubuntu: Invalid Bug description: When invoked in Gnome Terminal 3.0.1 (Ubuntu 11.10), showkey uninformatively exits after reporting: "Couldn't get a file descriptor referring to the console" For one who doesn't know what this means (such as myself), showkey is thus rendered unusable. The man page has no information about this behaviour. Installed kbd package: 1.15.2-3ubuntu1 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/kbd/+bug/1006676/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp