Advertisement

07.23.2008 at 04:47PM PDT, ID: 23590597
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

vsftpd under Centos - how to jail some user to their home dirs, let others see some dirs, let others see all

Asked by dlwynne in FTP Software, Linux Administration, FTP Servers

Tags: ,

I am building a LINUX box to replace and old legacy FTP server. I am using Centos and vsftpd.  The box is dedicated to FTP with only SSH and webmin running on it and only those ports open in the firewall. Webmin and SSH will be IP limited to in house or other trusted IPs. vsftpd will have to be able to accept connections from any IP, unless blocked. No anonymous access allowed.  At some point, we may add FTPS (FTP with SSL) to the box for users (the vsftpd is ready for that). I will be using SFTP (FTP over SSH) to move files back and forth, but that is just for me - not the users.

What I need to do is to allow some users access to just their home folders (and sub-folders under that):

These would be like:

user1  /home/user1
user2 /home/user2
user3 /home/user3

Then I need some users to have their own homes, but be able to navigate to some of the other users folders. Like:

user4 /home/user4  but can download, upload, rename, and delete in the folders of user1 and user3 but not user2 .

The I need some user that can see all the /home ftp folders, but can't back out to the OS or / folders

user5 /home/user5 but can see /home/user1-4 and delete, rename, upload, and download from those.

Finally I need a user (me) that can access any of those folders and back out to do whatever I need on the rest of the box.

I have it set up to chroot the users and have the user list on so I can exclude some users (like me) so I can go elsewhere.  I am just wondering what is best way to set this up. Do I just make the folks like "user4" a member of the user1 and user3 groups?  That is OK, but when I add more users and I have to back and add that group to all the new user groups. Since I don't want the lowest level users to see each others stuff, I can't make then a part of the same group.

Another though would be to put the homes of user1-3 in a sub folder:

user1 /home/lowlevelusers/user1
user2 /home/lowlevelusers/user2
user3 /home/lowlevelusers/user3

Then I could make the home of user4 /home/lowlevelusers and then they could see the user 1-4 folders. I think I would still have to make them part of groups or they could not delete or download the files. Maybe that is the key - I DO make a lowleveluser group and make users 1-3 members but jail them to their own folders, then make user4 a member of their own group AND lowleverusers.  Then when we add more low level users we just make them part of the lowlevelusers group (only) and then user 4 automatically gets to see the new folder and access what is placed there?

Then user5's home could be just /home and make them part of user4's group and also lowlevelusers group?  Then they could see and do it all, but could not back out into the rest of the box?

I saw mention of a user config file (/etc/vsftp_user/conf/user4) and that would seem to work to be a help, but I need to do it as simple as possible so someone using webmin could do this and not have to SSH in and mess with files at a low level.

My config file so far is pasted below. If anything related OR unrelated to the user levels needs to be added, changed, or deleted then please let me know.

anonymous_enable=NO
local_enable=YES
local_umask=022
anon_upload_enable=NO
#anon_mkdir_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
idle_session_timeout=900
#data_connection_timeout=120
#nopriv_user=ftpsecure
#async_abor_enable=YES
ftpd_banner=Welcome to our FTP server.
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd.banned_emails
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
chroot_local_user=YES
#ls_recurse_enable=YES
pam_service_name=vsftpd
userlist_enable=YES
#enable for standalone mode
listen=YES
tcp_wrappers=YES
ascii_download_enable=YES
#When enabled, ASCII mode data transfers will be honoured on downloads.
ascii_upload_enable=YES

Start Free Trial
[+][-]07.26.2008 at 01:43PM PDT, ID: 22096159

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.28.2008 at 06:36AM PDT, ID: 22102945

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]09.08.2008 at 04:15PM PDT, ID: 22422463

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: FTP Software, Linux Administration, FTP Servers
Tags: Centos, vsftpd
Sign Up Now!
Solution Provided By: dlwynne
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628