I am working on a remote virtual machine running Centos 7 via ssh. I want to give my user read and write permissions on /var/www/html. What I did is:
sudo groupadd webdev
sudo chgrp -R webdev /var/www/html
sudo usermod -a -G webdev centos
sudo usermod -a -G webdev root
sudo chmod -R 770 /var/www/html
sudo chown -R root:webdev /var/www/html
Some checks I made:
groups centos
>> centos : centos adm wheel systemd-journal webdev
sudo ls -l /var/www/html
>> -rwxrwx---. 1 root webdev 418 6 feb 11.19 index.php
...
However, when I try to edit a file (e.g. index.php) without sudo, I get a blank file in nano. Moreover, I cannot upload files with sftp on this folder and user centos. How can I fix this?