FTP: Copying files to remote side failed. Can't open that file: Permission denied

Discussion in 'Installation/Configuration' started by skysky, Jul 15, 2021.

  1. skysky

    skysky Member

    Hi
    I created a FTP account by selecting the website in ispconfig, but I got this error when trying to edit file using FTP.
    Copying files to remote side failed. Can't open that file: Permission denied

    I know this is file ownership issue. the file is owned by the website user. my question is how do I create a FTP account same as the website file owner user? how to fix this issue?

    thanks
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That's ok, as FTP runs as the website user.

    That's always the case, you can't even create FTP users that do not run as website user in ISPConfig, at least unless you manually change some advanced options. So your issue must be caused by something different. To find out what the cause is, post a 'ls -la' of the affected directory and also the FTP log from your FTP client.
     
  3. skysky

    skysky Member

    [email protected]:~# ls -la /var/www/clients/client0/web2/web/components/com_cmliv
    total 56
    drwxr-xr-x 7 web2 client0 4096 Jul 2 12:50 .
    drwxr-xr-x 71 web2 client0 4096 Jul 2 12:50 ..
    drwxr-xr-x 6 web2 client0 4096 Jul 2 12:50 assets
    -rw-r--r-- 1 web2 client0 980 Jul 2 12:50 cmlivedeal.php
    -rw-r--r-- 1 web2 client0 5823 Jul 2 12:50 controller.php
    drwxr-xr-x 2 web2 client0 4096 Jul 15 11:22 controllers
    -rw-r--r-- 1 web2 client0 31 Jul 2 12:50 index.html
    drwxr-xr-x 7 web2 client0 4096 Jul 2 18:27 language
    drwxr-xr-x 4 web2 client0 4096 Jul 7 09:50 models
    -rw-r--r-- 1 web2 client0 9719 Jul 2 12:50 router.php
    drwxr-xr-x 12 web2 client0 4096 Jul 2 12:50 views
     
  4. skysky

    skysky Member

    I know what is wrong. I login as root using SFTP to edit the website file, and so the file owner ship changed to root., and so the FTP user can not edit.

    I should not use root to edit website files. I created a shell user for the website. everything ok now.
    thanks
     
    Last edited: Jul 15, 2021
    till likes this.

Share This Page