Solved

how to give access to website folders using ftp?

Posted on 2014-01-14
15
697 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
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 

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

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

717 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