LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-01-2012, 04:02 PM   #1
tonyatvt
LQ Newbie
 
Registered: Jun 2012
Posts: 2

Rep: Reputation: Disabled
How to manage user specific access in Linux using vsftpd and virtual user?


Hi,

I searched for several days but couldn't find an answer. Before I am using a windows server to run the ftp. It was easy and straightforward to setup users and determine their access for every folder. Now using Centos and vsftpd I am struggling how to manage this correctly.

So what I am using is: vsftpd + berkeley db to create virtual users and lock all users in root folder say /opt/ftproot.

What I need is, suppose there are many folders under /opt/ftproot, say /opt/ftproot/A, /opt/ftproot/B...

I want assign access in a user specific and folder specific way. Eg., user1 can read all folders, but only can write in /A; user2 only can read /B; user3 can write /B and /C and read all others...

Could you advise how to realize this? Thanks for helping out!!
 
Old 06-03-2012, 02:44 AM   #2
lonelyman
Member
 
Registered: May 2012
Location: Shanghai
Distribution: redhat,centos,fedora
Posts: 63
Blog Entries: 4

Rep: Reputation: Disabled
here are some steps that i did before,hope that this would help,."Built based on virtual users vsftpd server's steps on centos5.0"
1:A virtual FTP user account database file
[root@filesvr ~]# vi /etc/vsftpd/vusers.list
mike
123
john
456
[root@filesvr ~]# cd /etc/vsftpd/
[root@filesvr vsftpd]# db_load -T -t hash -f vusers.list vusers.db
[root@filesvr vsftpd]# file vusers.db
vusers.db: Berkeley DB (Hash, version 8, native byte-order)
[root@filesvr vsftpd]# chown 600 /etc/vsftpd/vusers.*
[root@filesvr ~]# mkdir /var/ftproot
[root@filesvr ~]# useradd -d /var/ftproot -s /sbin/nologin virtual
[root@filesvr ~]# chmod 755 /var/ftproot/
2:Established to support virtual users PAM authentication file
[root@filesvr ~]# vi /etc/pam.d/vsftpd.vu
#%PAM-1.0
auth required pam_userdb.so db=/etc/vsftpd/vusers
account required pam_userdb.so db=/etc/vsftpd/vusers
3:in the vsftpd.conf file to add support configuration
[root@filesvr ~]# vi /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
anon_umask=022
guest_enable=YES
guest_username=virtual
pam_service_name=vsftpd.vu
4:Establishment of an independent configuration files for individual virtual users
[root@filesvr ~]# mkdir /etc/vsftpd/vusers_dir/
[root@filesvr ~]# cd /etc/vsftpd/vusers_dir/
[root@filesvr vusers_dir]# touch mike
[root@filesvr vusers_dir]# vi john
anon_upload_enable=YES
anon_mkdir_write_enable=YES
5:Reload vsftpd configuration
here are some options that i think would help you:http://docs.redhat.com/docs/en-US/Re...ftpd-conf.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Which is safer? Only ssh +scp for 2 users? Or ssh (1 user) + vsftpd (1 virtual user) bvz Linux - Security 2 09-18-2011 08:55 PM
Problem Manage User at Vsftpd Server sinchan Linux - Server 2 11-23-2006 11:42 PM
LXer: Linux 101: Manage user accounts in a multi-user Linux environment ... LXer Syndicated Linux News 0 06-27-2006 07:03 AM
vsftpd virtual user LinuxNoobs Linux - Software 1 05-20-2003 06:15 AM
vsftpd virtual user help zmerch Linux - Software 0 01-28-2003 06:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration