LinuxQuestions.org
Visit Jeremy's Blog.
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 01-19-2013, 05:14 PM   #1
cr-atlanta
LQ Newbie
 
Registered: Jan 2013
Location: Atlanta, GA, USA
Distribution: Gentoo, OSX
Posts: 18

Rep: Reputation: Disabled
VSFTPD Virtual/Local local_root Permissions Problem (alllmost there)


Hi everybody,

I'm running a Gentoo virtual machine and I'm playing around with vsFTPd version 3.0.2, I have it pretty much working the way that I want, but I have just one problem that I'd like to see if I can resolve.

I have a virtual and local user setup. I have created the user 'virtual' in the group 'virtual'. Both virtual users and local users can log-in, virtual users can upload, but local users cannot. Clearly the problem is that all users, local and virtual, are acting as the user 'virtual' (guest_username=virtual) - I have the virtual users' local_roots owned by the user 'virtual', but local users' local_root is just their home directory, which is clearly not owned by 'virtual'.

Each virtual user has a configuration file (user_config_dir=/etc/vsftpd/user_conf) - in each of those files I specify the local_root for that user, which will be owned by 'virtual' - it works great. If I do not make a config file for each local user (also in /etc/vsftpd/user_conf/) the local user is directed to the home directory for the user 'virtual' when they log-in.

So, my questions:

1) How can I make it so that local users log-in as themselves, and not as the guest user 'virtual' - such that they have permission to write to their home directories.
2) Is there a better, more automated way of having vsFTPd determining the local_root of a local user than looking at that user's config file in user_config_dir? Such that if a local user logs-in that they are acting as themselves (thus they are able to write to their home directory).

I have tried setting local_root=/home/$USER in vsftpd.conf, which won't work, a) because the user 'virtual's home folder isn't at /home/virtual (just the way I set it up), b) and all users come in as the user 'virtual', so even if /home/virtual did exist I would still not be accomplishing what I want.

My vsftp.conf:
Code:
#GENERAL
#------
listen=YES
dirmessage_enable=YES
# banner_file=/etc/vsftpd/vsftpd.banner # edit banner first
chown_uploads=YES
xferlog_enable=YES
idle_session_timeout=600
data_connection_timeout=120
#ascii_upload_enable=YES
#ascii_download_enable=YES
ls_recurse_enable=NO
pam_service_name=ftp
file_open_mode=0666
local_umask=0002

#LOCAL
#----
local_enable=YES
write_enable=YES

#the next 3 settings make it such that only users listed in user_list have access
userlist_file=/etc/vsftpd/user_list
userlist_enable=YES
userlist_deny=NO

#ANON
#----
anonymous_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO

#CHROOT
#------
allow_writeable_chroot=YES
chroot_list_enable=YES
virtual_use_local_privs=YES
chroot_local_user=YES
chroot_list_file=/etc/vsftpd/vsftpd.chroot

#VIRTUAL
#------
guest_enable=YES
guest_username=virtual
user_config_dir=/etc/vsftpd/user_conf
anon_upload_enable=YES
My /etc/pam.d/ftp file:
Code:
auth    sufficient      /lib/security/pam_unix.so
account sufficient      /lib/security/pam_unix.so

auth    sufficient      /lib/security/pam_userdb.so db=/etc/vsftpd/virtual_users
account sufficient      /lib/security/pam_userdb.so db=/etc/vsftpd/virtual_users
A typical file in /etc/vsftpd/user_conf (/etc/vsftpd/user_conf/queen here):
Code:
local_root=/var/www/virtual/queen
Any ideas? I would greatly appreciate any help!

Thanks a lot!


Last edited by cr-atlanta; 01-19-2013 at 08:29 PM. Reason: realized my vsftpd.conf was incorrect
 
Old 01-21-2013, 06:53 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
I haven't set up virtual users recently but going by the man page:

Quote:
guest_enable
If enabled, all non-anonymous logins are classed as "guest"
logins. A guest login is remapped to the user specified in the
guest_username setting.
Could you try changing that to NO ?
 
  


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
[SOLVED] How to enable BOTH virtual & local vsftpd logins with PAM? quasidynamic Linux - Software 3 08-12-2010 12:00 PM
vsFTPd virtual AND local users gag.halfrunt Linux - Software 0 02-17-2006 10:25 AM
VSFTPD, directrories permissions for virtual users. mussi Linux - Software 0 09-12-2005 03:59 AM
vsftpd problem with local_root Sirkent Linux - Software 2 08-23-2004 10:08 AM

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

All times are GMT -5. The time now is 07:43 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