I have an Apache based web site and am trying to allow the user to upload files to a drop box on one machine and then have them transferred to another. So I form a group for two users: www-data which is the Apache web user and OtagoHarbour which has a key to transfer files from one machine to another.
The existence of the group and its members is confirmed thus.
OtagoHarbour@WebServer:/var/www$ egrep -i "www-OtagoHarbour" /etc/group
www-OtagoHarbour:x:1002:OtagoHarbour,www-data
However, this does not appear to give OtagoHarbour group permissions to a group owned by www-data.
OtagoHarbour@WebServer:/var/www$ sudo ls -ld dropbox
drwx-wx-wx 2 www-data root 4096 2014-01-20 23:25 dropbox
OtagoHarbour@WebServer:/var/www$ sudo chmod g+r dropbox
OtagoHarbour@WebServer:/var/www$ sudo ls -ld dropbox
drwxrwx-wx 2 www-data root 4096 2014-01-20 23:25 dropbox
OtagoHarbour@WebServer:/var/www$ scp /var/www/dropbox/*.cel 192.168.1.6:/var/www/dropbox
/var/www/dropbox/*.cel: No such file or directory
OtagoHarbour@WebServer:/var/www$ sudo chmod o+r dropbox
OtagoHarbour@WebServer:/var/www$ scp /var/www/dropbox/*.cel 192.168.1.6:/var/www/dropbox
whatever1.cel 100% 11MB 11.3MB/s 00:01
whatever2.cel 100% 11MB 11.2MB/s 00:01
whatever3.cel 100% 11MB 11.2MB/s 00:01
So, despite www-data and OtagoHarbour being in the same group, g+r does not appear to give OtagoHarbour read access to a group owned by www-data (but o+r does).
Update
OtagoHarbour@WebServer:/var/www$ sudo chgrp -R www-OtagoHarbour /var/www/dropbox
OtagoHarbour@WebServer:/var/www$ sudo chmod o-r dropbox
OtagoHarbour@WebServer:/var/www$ sudo chmod g+r dropbox
OtagoHarbour@WebServer:/var/www$ scp /var/www/dropbox/*.cel 192.168.1.6:/var/www/dropbox
/var/www/dropbox/*.cel: No such file or directory
Update 2
OtagoHarbour@WebServer:/var/www$ ld
ld: no input files
OtagoHarbour@WebServer:/var/www$ ls -l /var/www/dropbox/*.cel
ls: cannot access /var/www/dropbox/*.cel: No such file or directory
OtagoHarbour@WebServer:/var/www$ ls -l /var/www/dropbox
ls: cannot open directory /var/www/dropbox: Permission denied
OtagoHarbour@WebServer:/var/www$
OtagoHarbour
user run thegroups
command to make sure its group list includeswww-OtagoHarbour
? Group membership is set only by programs likelogin
orsu
. A shell process (and any ordinary process spawned from it) that was created prior to/etc/group
being updated won't have its groups changed.