Link to home
Start Free TrialLog in
Avatar of dimensionav
dimensionavFlag for Mexico

asked on

how to give access to website folders using ftp?

According with this question, now I have an ftp server from a CentOS distro, actually I have created a user but now I wonder how to associate that user with the folder in which should connect to:
https://www.experts-exchange.com/questions/28336243/How-to-set-up-a-static-IP-in-a-CentOS-Server-6-5.html

We pretend to install more than one website in the CentOS vps, and assign one or more ftp user(s) to each website folder.

Regards.
Avatar of Mazdajai
Mazdajai
Flag of United States of America image

Assuming you already created local user account, it will most likely in their respective home drive in /etc/passwd once they logged in via ftp. We won't know until you provide more information on the type of ftp software and configuration file.
Avatar of dimensionav

ASKER

First of all, I have tried to get into FTP, but I couldn't never be connected, I tested the user and password directly on the server and everything is ok.

I have installed LAMP, so the idea is to get access to home folder of each website there.
OK...

1. Create a local user having access to that directory
2. Configure VSFTPD with default parameters.
3. either disable SELinux or configure setsebool for ftp_home_dir and ftp_full_access

You users will be able to access web folders via ftp. in case issues you might need to allow few booleans of http... depends on version and distro you are using

Its SELinux which is playing around. :)

TY/SA
After your post I did what is showed here: http://yohanes.pradono.com/2012/11/18/installing-vsftpd-with-virtual-users-enabled-and-using-pam_pwdfile-for-authentication

But I couldn't have success.

I have disabled SELinux and rebooted the server but I still got the message 530 Login incorrect.

Regards.
Are you trying with root ?

If yes,,, you need to remove entry of "root" user in below two files

1. /etc/vsftpd/ftpusers
2. /etc/vsftpd/users_list

If not please paste the screen output

TY/SA
I created a new user called vftpuser, just to make all the necessary tests.

You mean this?
User generated image
Add the "vftpuser" in the file /etc/vsftpd/user_list

And Try connecting...
Give me output of below

#sestatus

#setsebool -b | grep ftp

TY/SA
NARANTHIRAN:
After adding vftpuser to user_list file I got the error "530 Permission Denied" (Actually the link from I followed the procedure of setting up vsftp says that adding the user will block it).


 Sandeep_Agarwal_ :
#sestatus
SELinux status: disabled

#setsebool -b | grep ftp
setsebool: SELinux is disabled
ASKER CERTIFIED SOLUTION
Avatar of Sandy
Sandy
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sandy:

Now its working, but the FTP redirects to the user local folder, in this case "/home/test/" folder, is there any way to make the ftp user points to specific virtual host, lets say /var/www/html/mywebsite1 or /var/www/html/mywebsite2 ?

Thanks in advance.
Yes you can Point to the specific directory u want...
By editing the following file against the user and add the directory u want to point..

For example:
Username:x:502:503::/var/www/html/mywebsite1:/bin/bash
Sorry, could you explain a little bit more how to perform that command and the file edition?
Thanks.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Correct... Use usermod

TY/SA