If you are using sftp client to quick edit few files on your web server you must have face the issue of not having permission to edit files.
This can be quickly fixed in 2 steps:
- Adding the
ubuntuuser to thewww-datagroup - Giving write permission to everyone in this group
Adding the user:
Run this command to add the ubuntu user to the www-data group
sudo addgroup ubuntu www-dataYou have to logout and login back again for changes to take effect.
Give the write permission:
Assuming your web directory is /var/www we run following command to give everyone in the www-data group write permission to this directory
sudo chmod g+w /var/www -RTry editing or creating new file in /var/www directory to verify