?
Solved

how to give access to website folders using ftp?

Posted on 2014-01-14
15
Medium Priority
?
741 Views
Last Modified: 2014-03-07
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:
http://www.experts-exchange.com/OS/Linux/Q_28336243.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.
0
Comment
Question by:dimensionav
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +1
15 Comments
 
LVL 21

Expert Comment

by:Mazdajai
ID: 39780972
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.
0
 

Author Comment

by:dimensionav
ID: 39781025
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.
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39784890
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
0
Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

 

Author Comment

by:dimensionav
ID: 39786397
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.
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39788101
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
0
 

Author Comment

by:dimensionav
ID: 39791125
I created a new user called vftpuser, just to make all the necessary tests.

You mean this?
vsftperror
0
 
LVL 5

Expert Comment

by:NARANTHIRAN
ID: 39794026
Add the "vftpuser" in the file /etc/vsftpd/user_list

And Try connecting...
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39795988
Give me output of below

#sestatus

#setsebool -b | grep ftp

TY/SA
0
 

Author Comment

by:dimensionav
ID: 39801366
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
0
 
LVL 13

Accepted Solution

by:
Sandy earned 1000 total points
ID: 39802319
#yum remove vsftpd

#yum install vsftpd

#service vsftpd restart

#useradd test
#passwd test (password)

#ftp localhost
user : test
password : password

###if it doesn't work then please see /etc/hosts.allow and /etc/hosts.deny once it might be possible that tcp_wrapper is denying you to enter

TY/SA
0
 

Author Comment

by:dimensionav
ID: 39843725
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.
0
 
LVL 5

Expert Comment

by:NARANTHIRAN
ID: 39843737
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
0
 

Author Comment

by:dimensionav
ID: 39844223
Sorry, could you explain a little bit more how to perform that command and the file edition?
Thanks.
0
 
LVL 21

Assisted Solution

by:Mazdajai
Mazdajai earned 1000 total points
ID: 39844393
use usermod -

usermod -d '/path/to/new/homedir/'  username
0
 
LVL 13

Expert Comment

by:Sandy
ID: 39846507
Correct... Use usermod

TY/SA
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

BIND is the most widely used Name Server. A Name Server is the one that translates a site name to it's IP address. There is a new bug in BIND (https://kb.isc.org/article/AA-01272), affecting all versions of BIND 9 from BIND 9.1.0 (inclusive) thro…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question