# Sftp with winscp in folder of website - permission denied

**URL:** <https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350>\
**Category:** Rocky Linux Help & Support\
**Created:** [January 28, 2025, 8:46pm UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350 "2025-01-28T20:46:54Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [January 31, 2025, 11:23am UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350/21 "2025-01-31T11:23:09Z")

</div>

> [@Blisk](#):
>
> `chmod 2775 /var/www/html`  
> But I still can not edit existing files in opencart.

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:

```bash
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.

---

<div class="post-metadata">

**Author:** ![Blisk](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@Blisk](https://forums.rockylinux.org/u/Blisk)\
**Post date:** [January 31, 2025, 11:51am UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350/22 "2025-01-31T11:51:48Z")

</div>

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

 ![slika](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/2X/e/e6511ad080f31e0be0fa1adc4fea3990e247c1bc.png)

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [January 31, 2025, 2:41pm UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350/23 "2025-01-31T14:41:50Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![diamantopoulos12](https://avatars.discourse-cdn.com/v4/letter/d/58956e/32.png) [@diamantopoulos12](https://forums.rockylinux.org/u/diamantopoulos12)\
**Post date:** [January 31, 2025, 6:03pm UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350/24 "2025-01-31T18:03:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Blisk](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@Blisk](https://forums.rockylinux.org/u/Blisk)\
**Post date:** [January 31, 2025, 6:20pm UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350/25 "2025-01-31T18:20:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Blisk](https://avatars.discourse-cdn.com/v4/letter/b/b3f665/32.png) [@Blisk](https://forums.rockylinux.org/u/Blisk)\
**Post date:** [January 31, 2025, 6:21pm UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350/26 "2025-01-31T18:21:06Z")

</div>

yes I have both and will check and post

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [April 1, 2025, 6:22pm UTC](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350/27 "2025-04-01T18:22:04Z")

</div>

Closed on April 1, 2025, 6:22pm UTC

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

[Previous page](https://forums.rockylinux.org/t/sftp-with-winscp-in-folder-of-website-permission-denied/17350.md?page=1)
