How do i give the user
'testuser' write privileges on the folder:
The simplest way is to use
sudo chown -R testuser:testuser /var/www/test/public_html
This will make the user & group
testuser the owner of the file. IF YOU ARE USING A DIFFERENT USERNAME (run
whoami or look before the
@ of your terminal promp, or be lazy and replace
$USER), use that username instead. For instance user
Flora colossus may have the username
groot, in which case you would run
sudo chown -R groot:groot... . If in doubt use the manual pages linked below.
or to use
chmod (read and use carefully):
sudo chmod -R 777 /var/www/test/public_html
Which will allow read-write-execute permissions for the owner, group, and any other users. The execute bit is required for directories to work, files can get by with
666 permissions (strictly speaking most files shouldnt need the execute permission, but this is least likely to break stuff and does not require
chmod is much more difficult to 'undo' if needed that the other options.
Also beware giving global write access with the
chmod command if you have not as trustworthy users/scripts running on the server etc - I recommend changing the group or the user permissions instead. If using
chmod please read up on this and understand what it is doing.