Solved

how to give access to website folders using ftp?

Posted on 2014-01-14
15
644 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
wifi not working on Raspberry Pi 3? 2 116
Help With Shell Script Centos 6 6 93
Trying to install php56 on CentOS 7 get GPG error 5 42
RPM creation 6 29
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

696 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