Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using CentOS 6 (64bit) and have VSFTPD installed.

I have two different users for vsftpd: privateuser and publicuser.

I need to configure that only privateuser can login to the ftp server from the local IP range (192.168.2/24) and publicuser can login from both the local range and another public range (example 192.168.2/24 and 180.150/16).

Is there any solution for this?

share|improve this question

1 Answer 1

You can't do this directly with vsftpd. You may get some mileage with pam_access e.g.

edit /etc/pam.d/vsftpd and add the line

account    required    pam_access.so

to the beginning of the file, then edit /etc/security/access.conf and add the lines

- : privateuser : ALL EXCEPT 192.168.2.0/24
- : publicuser : ALL EXCEPT 192.168.2.0/24 180.150.0.0/16

which I think does what you want.

You may find it easier to switch to something like proftpd which has a richer set of access controls.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.