Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8778931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:39:03+00:00 2026-06-13T19:39:03+00:00

On a linux program, on the console (as in no xorg, etc), I’m using

  • 0

On a linux program, on the console (as in no xorg, etc), I’m using using /dev/input/event* to read keyboards and mice, however I need to be root to be able to read them. Is there an alternative form to read that stuff without needing root privileges (without having to change permisons and config files, etc)?

I understand why it does that by default no need to explain that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T19:39:04+00:00Added an answer on June 13, 2026 at 7:39 pm

    Check to see to which group the device files belong to. For example, here I get:

    $ ls -l /dev/input/
    ...
    crw-rw---- 1 root plugdev 13, 64 Nov  4 18:01 event0
    crw-rw---- 1 root plugdev 13, 65 Nov  4 18:01 event1
    crw-rw---- 1 root plugdev 13, 66 Nov  4 18:01 event2
    crw-rw---- 1 root plugdev 13, 67 Nov  4 18:01 event3
    crw-rw---- 1 root plugdev 13, 68 Nov  4 18:01 event4
    ...
    

    The user executing your program needs to be in the plugdev group on this system. Something similar is probably the case on your system.

    If you’re asking for a way to circumvent that (reading or writing to the device without being in the group), then no. That would obviously defeat the purpose of security though user groups.

    An alternative to reading the event devices directly would be to use an appropriate user space API instead. For example, to read the keyboard you would use ncurses, and to read the mouse you would use GPM.


    NOTE: To add existing user into group, execute the next command:

    $ sudo usermod -a -G groupname username
    

    For example (for case above – ‘input’ group named plugdev):

    $ sudo usermod -a -G plugdev $USER
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Linux console and I would like to do a program which outputs
I'm writting a Ruby program for windows, and I need to read user input
I got a source for console program written in c++ for linux Is there
I'm trying to package a Linux program for Mac OS X using py2app. My
I writing a PHP script program under Linux. In the script, I need call
Aim: to create user friendly web interface to linux program without any ssh (console)
How can I give commands to Linux console (Ubuntu) from my c++ program, and
I have a linux console application - a scientific simulation program that I use.
I need a cross platform solution for clearing the console in both Linux and
When using iostream in C++ on Linux, it displays the program output in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.