All of a sudden I'm getting permission errors

by Ejaz   Last Updated July 10, 2018 17:02 PM

I'm running Ubuntu 16.04.4 LTS and facing a problem. All of a sudden I'm unable to edit files that I could before, I cannot run programs due to permission errors.

I'm always logged in as a user ejaz belonging to primary group ejaz and secondary groups root adm cdrom sudo dip www-data plugdev lpadmin sambashare kismet wireshark docker. I have several websites in sub-directories of /var/www/html/ (not in ~/public_html because it is a dev machine with no security/sharing considerations). Taking a website, /var/www/html/test, for example; it belongs to user:group www-data:www-data. Me, logged in as ejaz, am getting permission errors while editing files in test directory. I seem to have correct group permissions to edit this directory.

Output of groups command

~ » groups ejaz                                                                                                                                                              
ejaz : ejaz root adm cdrom sudo dip www-data plugdev lpadmin sambashare kismet wireshark docker

Permissons for test site

/var/www/html » l | grep test
drwxrwxr-x  2 www-data www-data 4.0K Apr  9  2017 test

But any editing results in permission errors

/var/www/html » cd test 

/var/www/html/test » l                                                                                                                                                           
total 16K
drwxrwxr-x  2 www-data www-data 4.0K Apr  9  2017 .
drwxrwxr-x 87 www-data www-data 4.0K Jul 10 06:50 ..
-rw-rw-r--  1 www-data www-data    0 Apr  9  2017 blah.html
-rw-rw-r--  1 www-data www-data   16 Apr  9  2017 .htaccess
-rw-rw-r--  1 www-data www-data   73 Apr  9  2017 index1.html

/var/www/html/test » touch blah.html
touch: cannot touch 'blah.html': Permission denied

Output of id command

/var/www/html/test » id -Gn
ejaz

which is understandable since ejaz is the primary group.

But If I su as ejaz, I'm able to edit the file in terminal and in any program that is launched from that particular terminal instance

Question

Why am I not able to edit the files all of a sudden and how was I able to edit those files before? All I did since yesterday was to run Ubuntu's apt upgrade.

Any help will be greatly appreciated.
Thanks for reading.



Related Questions


Folder access permissions - how do they work?

Updated May 11, 2017 01:02 AM

Default user permissions

Updated May 29, 2017 00:02 AM

Group permissions not kicking in

Updated September 01, 2015 18:01 PM

Change group permission for usb device permanently

Updated April 08, 2017 00:02 AM

Users unable to access group folder

Updated July 11, 2018 17:02 PM