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
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.
~ » groups ejaz ejaz : ejaz root adm cdrom sudo dip www-data plugdev lpadmin sambashare kismet wireshark docker
/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
/var/www/html/test » id -Gn ejaz
which is understandable since
ejaz is the primary group.
But If I
ejaz, I’m able to edit the file in terminal and in any program that is launched from that particular terminal instance
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.