System user cannot see httpdocs via FTP

Created:

2016-11-16 12:52:07 UTC

Modified:

2017-04-24 12:09:14 UTC

0

Was this article helpful?


Have more questions?

Submit a request

System user cannot see httpdocs via FTP

Applicable to:

  • Plesk for Linux
  • Plesk 12.0 for Windows

Symptoms

Domain system user cannot see the httpdocs directory when connected via FTP

lftp testuser@12.123.124.125:~> dir
drwxr-xr-x 8 testuser psacln 4096 Apr 15 15:25 cgi-bin
drwxr-xr-x 2 testuser psacln 4096 Mar 19 12:03 error_docs
drwxrw-rw- 2 testuser root 4096 Apr 8 03:09 logs

lftp testuser@12.123.124.125:/> cd httpdocs
cd: Access failed: 550 /httpdocs: No such file or directory

But if you connect via ssh, you can see that the directory is there

# ll
total 12
drwxr-xr-x 8 testuser psacln 4096 Apr 15 15:25 cgi-bin
drwxr-xr-x 2 testuser psacln 4096 Mar 19 12:03 error_docs
drwxr-xr-x 14 testuser psaserv 4096 Apr 8 11:25 httpdocs
drwxrw-rw- 2 testuser root 4096 Apr 8 03:09 logs

Probably some permission problem, but I cannot understand where.

Cause

A .ftpaccess file is meant to function like Apache's .htaccess file: a file that acts as free-floating section of the server's configuration file. If a .ftpaccess file is present in a directory in which the server looks, it will parse that .ftpaccess file as a configuration file, and act accordingly. Only some configuration directives are allowed in the .ftpaccess context, though. The advantage of having this capability is that users can customize how the server treats directories that are under the user's control via files placed in those directories, instead of allowing the user to modify the main server configuration file itself. The disadvantage is that a user is capable of possibly overriding a configuration value that was set in the main configuration file for a specific purpose.

The server treats a directory that contains a .ftpaccess file exactly as if the configuration directives in that file had been placed in a <Directory> section in the main proftpd.conf file. For example, if there is a /home/users/bob directory on your system, and in that directory there was a .ftpaccess that contained:

DirFakeUser on ~
DirFakeGroup on ~
Umask 0077

it would be treated exactly as if:

  <Directory /home/users/bob>
DirFakeUser on ~
DirFakeGroup on ~
Umask 0077
</Directory>

was written into proftpd.conf .

Resolution

Find and rename .ftpaccess file in the directory:

# ls -la /var/www/vhosts/example.com/httpdocs | grep ftp
-rw-r--r-- 1 testuser psacln 279 Feb 14 12:49 .ftpaccess

# cat /var/www/vhosts/example.com/httpdocs/.ftpaccess
<Limit ALL>
Order Allow,Deny
Allow from 12.13.14.123
Deny from all
</Limit>

# mv /var/www/vhosts/example.com/httpdocs/.ftpaccess /var/www/vhosts/example.com/httpdocs/.ftpaccess_old
Have more questions? Submit a request
Please sign in to leave a comment.