• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

FTP Users and httpdocs

M

Mansour

Guest
Hi
I have a problem with Plesk 8.2 regarding to ftp account which I can’t solve it. My requirements are:
We have many users with ftp account, they should see only one directory and they have to upload a files through FTP connection.
Then the user should go to the PHP script which read the files that he just uploaded them and then the script will move the files from the user directory to a script directory.

To do that, I create web user accounts for each user, so the user have a directory under this path:
/var/www/vhosts/domain.com/web_users/$userid
Then configure the php script to read all the files in the user directory. But I have this error:
Warning: opendir(): open_basedir restriction in effect. File(/var/www/vhosts/ domain.com/web_users/user1/) is not within the allowed path(s): (/var/www/vhosts/domain.com/httpdocs:/tmp) in /var/www/vhosts/domain.com/httpdocs/FileSystem.php on line 372

I try to resolve this error by two way:
1- Try to allow php script to access to web_user directory through configure open_basedir. I couldn’t do that, I try by different ways but no one works.

2- Try to solve this issue by place a symbolic link to a web_users directory, but even this not work, I will explain number 2 with all the steps as what I understand from difrents post:

First, I have a directory which have a sub directory for each user under httpdocs
/var/www/vhosts/domain.com/httpdocs/Files
and the sub directory should be like this
/var/www/vhosts/domain.com/httpdocs/Files /U1
/var/www/vhosts/domain.com/httpdocs/Files /U2
/var/www/vhosts/domain.com/httpdocs/Files /U3

Now I will try to add a link in web_users to the user directory (e.g. U1) under ‘httpdocs/Files:

[root@server /]#
[root@server /]# ln -s /var/www/vhosts/ domain.com/httpdocs /Files/U1 user1
[root@server /]# mv user1 /var/www/vhosts/ domain.com/web_users/

No I create a web user under name ‘user1’, Now whey I try to access the server through FTP with user1 account, the server not allow me to access, I have to delete the symbolic then create new file wit the same name and correct owner and group.
I try to change the link owner and group, just in case

[root@server /]# chown -h user1.psaserv user1
but even this did not solve the problem.

[root@server /]# ftp localhost
Connected to localhost.
220 ProFTPD 1.3.0 Server (ProFTPD) [127.0.0.1]
500 AUTH not understood
500 AUTH not understood
KERBEROS_V4 rejected as an authentication type
Name (localhost:root): user1
331 Password required for user1.
Password:
530 Login incorrect.
Login failed.
421 Service not available, remote server has closed connection
ftp>

Could anyone help me please, whatever by option 1 or 2.
 
Hi again
I tried this command also :
[root@server /]# useradd -u 10041 -d /var/www/vhosts/domain.com/httpdocs/Files/U1 -g psacln -s /bin/false user1
[root@server /]# passwd user1

but it did not work, (530 Login incorrect.)
 
If I Add a user in passwd with bin/nologin as shell , that user can't login in ftp (authentication failure reporter by proftp in log/message). Replacing nologin with chrootsh or any other shell solves the problem.

But why can all other users created by plesk itself access ftp with bin/nologin as shell!

Is this related to PAM?
 
Back
Top