Solved

ftp configuration

Posted on 2011-02-28
9
306 Views
Last Modified: 2012-05-11
Hello experts,
             I have a doubt regarding ftp. I installed and setup vsftpd on linux. I want to configure such a way that have 3 users A,B and C. They have home directories. Have a folder in / named A and inside it two folders B and C. A can ftp access to A,B and C. But B and C have access to their own B and C folder only. How to setup ftp access like this. Thanks in advance.
0
Comment
Question by:jacobbbc
9 Comments
 
LVL 3

Expert Comment

by:Gpramodkumar
ID: 34996133
If you are settingup the ftp share in windows then it is similar as providing sharing and security permissions for A on A,B,C folders and B 's access to folder B and C's access to folder C.
0
 

Author Comment

by:jacobbbc
ID: 34996212
@Gpramodkumar: my os is linux....
0
 
LVL 35

Expert Comment

by:torimar
ID: 34996423
The usual setup is to chroot ftp users to their home directories. For security reasons, this is highly recommended.

If you want users to be able to access files somewhere else in the directory tree, the trick I know of is to mount these folders with the '-bind' command. The trick is described here:
http://roglev.info/?p=41
http://www.ducea.com/2006/07/27/allowing-ftp-access-to-files-outside-the-home-directory-chroot/

In your case, you would have to create 3 different mountpoints, one for each ftp user, and you would also have to add them to the /etc/fstab file.
0
 
LVL 2

Accepted Solution

by:
maxalarie earned 500 total points
ID: 35003932
I guess you could create  your direcotries  and chamge the home folders of A,B and C.

/A would be the home folder of A
/A/B home folder of user B
/A/C home folder of user C
that way, A  have an access to to B and C stuff.

Open vsftpd configuration file - /etc/vsftpd/vsftpd.conf
check the option : chroot_local_user=YES


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

 

Author Comment

by:jacobbbc
ID: 35003992
@torimar: Is it not possible without mounting?
0
 

Author Comment

by:jacobbbc
ID: 35003997
@maxalarie: The folder A is not user A's home folder.
0
 
LVL 35

Expert Comment

by:torimar
ID: 35006483
>> "@torimar: Is it not possible without mounting?"

There are three conceivable ways of dealing with this issue:

1. Not to chroot your users and give them access to the complete filesystem:-> a security disaster, impossible.
2. To set the user's home folders to be identical with their FTP root folders, as suggested by maxalarie above:-> not practical for you.
3. The mount/bind trick.

I personally do not know of any other way, and an online research did not yield one either.
Have you tested the mount/bind trick? It means just typing one line in the terminal. If you find it working, it means only three more lines in the fstab. That's less work to do than in many other configuration tasks on Linux...
0
 
LVL 2

Expert Comment

by:ind_selva
ID: 35015324
change user's home directory.
#usermod -d /A a
#usermod -d /A/B b
#usermod -d /A/C c
0
 
LVL 6

Expert Comment

by:mohansahu
ID: 35016084
Hi,

For changing the user home directory in to a specified path ,need to modify in vsftpd.conf file & add the below line to end of  vsftpd.conf file.

pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
local_root=/named
anon_root=/named


Cheers,
MS


~

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

Suggested Solutions

Title # Comments Views Activity
Why VNC doesn't work in Redhat? 11 42
Determine Who is Runnig my Bash Shell Script 4 62
nagios 1 22
How to update  and reset admin password for Linux 5 41
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…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

910 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

20 Experts available now in Live!

Get 1:1 Help Now