Operating System - Linux
1832128 Members
3093 Online
110038 Solutions
New Discussion

vsftpd & pam.conf - RHES4 - virtual users

 
SOLVED
Go to solution
Jeff Hoevenaar
Frequent Advisor

vsftpd & pam.conf - RHES4 - virtual users

I am trying to setup virtual users within vsftpd on RedHat ES4. I have found that I need "pam" to do this. However, I cannot find any details of how these two are suppose to work together. The man page of pam seems limited and there is no actual pam.conf file installed. I believe pam is installed and I have vsftpd working with local users.

rpm -qa pam
pam-0.77-65.1

Any information on how to configure virtual users using pam.conf would be helpful.

Thanks.
10 REPLIES 10
Tvs
Regular Advisor

Re: vsftpd & pam.conf - RHES4 - virtual users

what u mean by virtual hosts
Tvs
Regular Advisor

Re: vsftpd & pam.conf - RHES4 - virtual users

sorry virtual users
Jeff Hoevenaar
Frequent Advisor

Re: vsftpd & pam.conf - RHES4 - virtual users

From the man page of vsftpd.conf:

virtual_use_local_privs

If enabled, virtual users will use the same privileges as local users. By default, virtual users will use the same privileges as anonymous users, which tends to be more restrictive (especially in terms of write access).
Ivan Ferreira
Honored Contributor

Re: vsftpd & pam.conf - RHES4 - virtual users

Do you want to configure a chrooted environment? Guest users?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jeff Hoevenaar
Frequent Advisor

Re: vsftpd & pam.conf - RHES4 - virtual users

I want to create individual users that I can put restrictions on - like download only. It looks like "virtual users" is what I need but finding details on this is difficult. I am very unfimiliar with pam - which is what i think i need. I found a config in /etc/pam/vsftpd.

Hoping to find details on how to configure pam for vsftpd.
Ivan Ferreira
Honored Contributor
Solution

Re: vsftpd & pam.conf - RHES4 - virtual users

The download only is controlled by:

anon_upload_enable
write_enable

If you enabled uploads, then you must setup the directory where the users can upload the files. If the users don't have write permissions for the directory, they won't be able to upload files, only download.

So, is recommended that you chroot the users to a directory with write permissions disabled, and for every user that you want to allow upload, create an upload directory with write enabled permissions for the directory.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jeff Hoevenaar
Frequent Advisor

Re: vsftpd & pam.conf - RHES4 - virtual users

anon_upload_enable
write_enable

Those control access for the user "anonymous". I want to control access on a per user basis. I believe I need to setup "virtual users" to do this.

i.e. user "jeff" can upload and download but user "fred" can only download. And they are each assigned seperate home directories.

Ivan Ferreira
Honored Contributor

Re: vsftpd & pam.conf - RHES4 - virtual users

Re-read my last post.

The filesystems permissions are the key.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jeff Hoevenaar
Frequent Advisor

Re: vsftpd & pam.conf - RHES4 - virtual users

Ok that works.

I thought there would be a way to use a configuration file or something - maybe it is not needed.

Thanks.
Hannes Piirsalu
Occasional Advisor

Re: vsftpd & pam.conf - RHES4 - virtual users

Seems that, this case is closed, but maybe someone still needs to set up virtual users...
Some time ago I allsaw needed to this. There is included complete howto in /usr/share/doc/vsftpd/EXAMPLE/VIRTUAL_USERS/README.gz
(I have Debian machine, but it not important. I hope it's included with RedHat package too).
If you do everything like this readme says...all goes ok. Just in case this readme is attached with this post. Important is - which db version you use, I was able to get it work with db3_load (db4_load did not work at all).
Good luck!