title: Serial port permission denied for non-root user with dialout group privileges even after reboot Ubuntu 18.04
body: <p>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 (<code>/dev/ttyS0</code>) on the PC. Serial port <code>ls -l</code>:</p>
  
  <p><code>Serial port: crw-rw---- 1 root dialout 4, 64 Jun 13 22:00 /dev/ttyS0</code></p>
  
  <p>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 <code>/dev/ttyS0</code>.</p>
  
  <p>mxdaemon is a member of both the <code>dialout</code> &amp; <code>tty</code> groups: </p>
  
  <p><code>mxdaemon : mxdaemon dialout tty</code></p>
  
  <p>Even after logging out and/or rebooting the PC, I still get permission denied for ANY user besides root.</p>
  
  <p>Hours of scouring the Internet suggest that everything is configured correctly.</p>
  
  <p>Any help would be appreciated!</p>
  
  <p>-Rob</p>
  
  <p>@sawdust: Thanks for the reply! Here's the info...</p>
  
  <p><code>/etc/group</code> : <code>dialout:x:20:mxdaemon,mxadmin</code></p>
  
  <p><code>/etc/gshadow</code> : <code>dialout:*::mxdaemon,mxadmin</code></p>
  
  <p>Thanks for the pointer @sawdust - here's what the command yielded...</p>
  
  <p><code>ps -o user= -o group= -p 15150</code></p>
  
  <p><code>mxdaemon root</code></p>
  
  <p>So, the user is <code>mxdaemon</code> but it shows being part of the <code>root</code> group?</p>