Serial port permission denied for non-root user with dialout group privileges even after reboot Ubuntu 18.04

会有一股神秘感。 提交于 2019-12-11 08:54:22

问题


I write systemd services that launch with root privileges and de-privilege themselves to a system account (called mxdaemon). These services require access to the physical serial port (/dev/ttyS0) on the PC. Serial port ls -l:

Serial port: crw-rw---- 1 root dialout 4, 64 Jun 13 22:00 /dev/ttyS0

When run as root, the service has no problem communicating via the serial port. When the service is configured to de-privilege to mxdaemon, I get a permission denied error when attempting to access /dev/ttyS0.

mxdaemon is a member of both the dialout & tty groups:

mxdaemon : mxdaemon dialout tty

Even after logging out and/or rebooting the PC, I still get permission denied for ANY user besides root.

Hours of scouring the Internet suggest that everything is configured correctly.

Any help would be appreciated!

-Rob

@sawdust: Thanks for the reply! Here's the info...

/etc/group : dialout:x:20:mxdaemon,mxadmin

/etc/gshadow : dialout:*::mxdaemon,mxadmin

Thanks for the pointer @sawdust - here's what the command yielded...

ps -o user= -o group= -p 15150

mxdaemon root

So, the user is mxdaemon but it shows being part of the root group?

来源:https://stackoverflow.com/questions/50858443/serial-port-permission-denied-for-non-root-user-with-dialout-group-privileges-ev

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!