Sftp with winscp in folder of website - permission denied

That changes what you can do in /var/www/html, but not what you can do in,
say /var/www/html/opencart

One can do things recursively for all files and subdirectories in a tree. One example:

chgrp -Rv nginx /var/www/html
find /var/www/html -type d -exec chmod -v 2775 '{}' \;
find /var/www/html -type f -exec chmod -v g+w '{}' \;

The first command ensures that every dir and file has group nginx.
Second sets the permissions of every directory, exactly.
Third adds the ‘w’ for group on every file.

If there are something that should not belong to that group, or dir that should not have 2775, then you need different commands.

1 Like

Thank you for this.
I did this and still can not open file and edit it and save in /var/www/html/opencart
really don’t know why I never had this much problems with adding new user which can do all as root.
Permission denied.
Error code: 3
Error message from server: Permission denied

You do show screenshots from some GUI file manager. Do you have a graphical desktop session as user purple1 on the server?

How about CLI tools. Do they have write access?

This reminds me of a problem I had once a long time ago deleting a file. The use case is completely different but try checking the file attributes. “lsattr -R /var/www/html” will list out the file attributes for you … maybe for some reason the non modifiable attribute is set somewhere. If it happens to be that you can change the attributes with the chattr command. Probably an unlikely cause, but worth a look.

it is like this
ivendor/class_excel/PHPExcel/Worksheet/RowIterator.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/SheetView.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/AutoFilter.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/BaseDrawing.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/CellIterator.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/AutoFilter

/var/www/html/opencart-bkp/system/library/purpletree_multivendor/class_excel/PHP Excel/Worksheet/AutoFilter:
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/AutoFilter/Column

/var/www/html/opencart-bkp/system/library/purpletree_multivendor/class_excel/PHP Excel/Worksheet/AutoFilter/Column:
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php

---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet/AutoFilter/Column.php

---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Autoloader.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/CachedObjectStorageFactory.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Calculation.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Cell.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Chart.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Comment.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/DocumentProperties.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/DocumentSecurity.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Exception.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/HashTable.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Helper

/var/www/html/opencart-bkp/system/library/purpletree_multivendor/class_excel/PHP Excel/Helper:
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Helper/HTML.php

---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/IComparable.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/IOFactory.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/NamedRange.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/ReferenceHelper.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/RichText

/var/www/html/opencart-bkp/system/library/purpletree_multivendor/class_excel/PHP Excel/RichText:
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/RichText/ITextElement.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/RichText/Run.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/RichText/TextElement.php

---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/RichText.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Settings.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Style.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/Worksheet.php
---------------------- /var/www/html/opencart-bkp/system/library/purpletree_mult ivendor/class_excel/PHPExcel/WorksheetIterator.php

---------------------- /var/www/html/opencart-bkp/system/library/session

/var/www/html/opencart-bkp/system/library/session:
---------------------- /var/www/html/opencart-bkp/system/library/session/db.php
---------------------- /var/www/html/opencart-bkp/system/library/session/file.ph p

---------------------- /var/www/html/opencart-bkp/system/library/cart

/var/www/html/opencart-bkp/system/library/cart:
---------------------- /var/www/html/opencart-bkp/system/library/cart/cart.php
---------------------- /var/www/html/opencart-bkp/system/library/cart/currency.p hp
---------------------- /var/www/html/opencart-bkp/system/library/cart/customer.p hp
---------------------- /var/www/html/opencart-bkp/system/library/cart/length.php
---------------------- /var/www/html/opencart-bkp/system/library/cart/tax.php
---------------------- /var/www/html/opencart-bkp/system/library/cart/user.php
---------------------- /var/www/html/opencart-bkp/system/library/cart/weight.php

---------------------- /var/www/html/opencart-bkp/system/library/db

/var/www/html/opencart-bkp/system/library/db:
---------------------- /var/www/html/opencart-bkp/system/library/db/mysqli.php
---------------------- /var/www/html/opencart-bkp/system/library/db/pdo.php
---------------------- /var/www/html/opencart-bkp/system/library/db/pgsql.php

---------------------- /var/www/html/opencart-bkp/system/library/mail

/var/www/html/opencart-bkp/system/library/mail:
---------------------- /var/www/html/opencart-bkp/system/library/mail/mail.php
---------------------- /var/www/html/opencart-bkp/system/library/mail/smtp.php

---------------------- /var/www/html/opencart-bkp/system/library/squareup

/var/www/html/opencart-bkp/system/library/squareup:
---------------------- /var/www/html/opencart-bkp/system/library/squareup/cron.p hp
---------------------- /var/www/html/opencart-bkp/system/library/squareup/cron_f unctions.php
---------------------- /var/www/html/opencart-bkp/system/library/squareup/except ion.php

---------------------- /var/www/html/opencart-bkp/system/engine

/var/www/html/opencart-bkp/system/engine:
---------------------- /var/www/html/opencart-bkp/system/engine/proxy.php
---------------------- /var/www/html/opencart-bkp/system/engine/registry.php
---------------------- /var/www/html/opencart-bkp/system/engine/router.php
---------------------- /var/www/html/opencart-bkp/system/engine/action.php
---------------------- /var/www/html/opencart-bkp/system/engine/controller.php
---------------------- /var/www/html/opencart-bkp/system/engine/event.php
---------------------- /var/www/html/opencart-bkp/system/engine/loader.php
---------------------- /var/www/html/opencart-bkp/system/engine/model.php

---------------------- /var/www/html/opencart-bkp/system/framework.php
---------------------- /var/www/html/opencart-bkp/system/helper

/var/www/html/opencart-bkp/system/helper:
---------------------- /var/www/html/opencart-bkp/system/helper/bbcode.php
---------------------- /var/www/html/opencart-bkp/system/helper/general.php
---------------------- /var/www/html/opencart-bkp/system/helper/utf8.php

---------------------- /var/www/html/opencart-bkp/system/modification.xml
---------------------- /var/www/html/opencart-bkp/system/startup.php

yes I have both and will check and post

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.