Solved

how to give access to website folders using ftp?

Posted on 2014-01-14
15
595 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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.…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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.:

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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now