Solved

how to give access to website folders using ftp?

Posted on 2014-01-14
15
604 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
  • 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
 

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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 250 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 250 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
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.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

867 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now