I'm writing an application to read/write to/from a serial port in Fedora14, and it works great when I run it as root. But when I run it as a normal user I'm unable to obtain the privileges required to access the device (/dev/ttySx). That's kind of crappy because now I can't actually debug the damn thing using Eclipse.

I've tried running Eclipse with sudo but it corrupts my workspace and I can't even open the project. So I'd like to know if it's possible to lower the access requirements to write to /dev/ttySx so that any normal user can access it. Is this possible?


The right to access a serial port is determined by the permissions of the device file (e.g. /dev/ttyS0). So all you need to do is either arrange for the device to be owned by you, or (better) put yourself in the group that owns the device, or (if Fedora supports it, which I think it does) arrange for the device to belong to the user who's logged in on the console.

For example, on my system (not Fedora), /dev/ttyS0 is owned by the user root and the group dialout, so to be able to acesss the serial device, I would add myself to the dialout group:

usermod -a -G dialout MY_USER_NAME
  • 1
    I'm going to accept this one since it got me on the right path. For Fedora, the command usermod is used after a user has been created. The group in question was also dialout for me: sudo usermod -a -G dialout <username>. Cheers. – iegod Jun 3 '11 at 20:24
  • 6
    Note that you may need to log out and log in to appear in the new group – Jan Špaček May 25 '15 at 19:42
  • 3
    By popular demand: sudo usermod -a -G dialout $USER :-) – Ciro Santilli 新疆改造中心法轮功六四事件 Jul 19 '18 at 18:06

Many distributions use group memberships to enable access to serial ports. I don't know details for Fedora offhand, though.


I think you can add yourself in sudoers file which will allow you to specify a set of commands as command alias which you would be able to execute without password. You can find an excellent tutorial about sudoers file in Ubuntu docs.

You can then run eclipse normally and it'd be able to execute those specific commands without root permissions.


i had this problem also back in the day, apart of adding user to a dialout group you need also to give the permission for that user to access /dev. simply su -> enter root password -> chmod -R 777 /dev -R, means recursive mode, everything within that folder will have the same permission

the problem is this, you need to do that every time you reboot your computer or plug in and out your device huh!!!

  • 4
    chmod -R 777 /dev is a very bad idea. – RalfFriedl Oct 11 '18 at 12:58
  • Yaah agree, if there is any other suggestion for this , that will be great – Tunu Yolim Ngajilo Oct 11 '18 at 13:22
  • I wonder if you needed to log out and back in again, as in the comment on the accepted answer? This often trips people up. – sourcejedi Oct 11 '18 at 13:39
  • 1
    Giving free access to all users to everything inside /dev/ is extremely unsafe to do. Please don't do this. – unfa Mar 4 '19 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.