0

I have two users mix and www-data (an apache server). I want that these two users have permissions to read and write in the Virtual Serial Port /dev/pts/3, i created this virtual port following this tutorial https://stackoverflow.com/questions/52187/virtual-serial-port-for-linux.

So I added these two users to the group serial:

sudo adduser www-data serial
sudo adduser mix serial

and I granted access to the group to /dev/pts/3

sudo chgrp serial testdir

and I added 775 permission to /dev/pts/3

I'm able to write and read with the user mix but I can't write with the user www-data. Am I doing something wrong?

EDIT:

I restarted my apache server and now it works

  • 2
    Group membership is actually per process, not per user. The thing about "adding a user to a group" is a simplification. It only means that when the user logs in, the process started in their name is given the group memberships implied by those membership settings. (The group membership propagates down to child processes then.) So, two things: 1) if your HTTP server was running when you changed the config, the running process will not be affected by the change; and 2) depending on how it's started, the group memberships it gets may or may not be set based on the same rules – ilkkachu Apr 10 '21 at 21:35
  • which Linux distribution are you running? – ilkkachu Apr 10 '21 at 21:38
  • ubuntu 20.04, so i need to restart the apache server – Juan Topo Apr 10 '21 at 21:57
  • Consider also access control lists setfacl. see https://unix.stackexchange.com/questions/101263/what-are-the-different-ways-to-set-file-permissions-etc-on-gnu-linux – ctrl-alt-delor Apr 10 '21 at 22:45
  • lol I restart my apache server and know it works – Juan Topo Apr 11 '21 at 00:12

0 Answers0