sudo ls -la /var/lib/redis/6379/
produces:
drwxrwxr-x 2 redis redis 4096 Nov 28 23:10 .
drwx-w---- 3 redis redis 4096 Nov 22 00:10 ..
srwxrwx--- 1 redis redis 0 Nov 28 23:10 redis.sock
Great, now sudo groups www-data
produces:
www-data : www-data redis
OK, but then sudo -u www-data -g www-data touch /var/lib/redis/6379/redis.sock
causes the following error:
touch: cannot touch ‘/var/lib/redis/6379/redis.sock’: Permission denied
This shouldn't happen to my understanding. Can someone point out where I'm completely wrong? The following doesn't work either with the same error (which is what I'm actually interested in):
sudo -u www-data -g www-data redis-cli -s /var/lib/redis/6379/redis.sock
with
Could not connect to Redis at /var/lib/redis/6379/redis.sock: Permission denied
This is on Debian 8.2.