21

I want to setup FTP server to allow only certain users, so with vsftpd, I add in vsftpd.conf:

local_enable=YES
user_config_dir=/etc/vsftpd_user_conf

In /etc/vsftpd_user_conf for the unix user foo I set in a file foo:

local_root=/home/foo/ftpdir
anon_world_readable_only=NO
write_enable=YES
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
virtual_use_local_privs=YES
local_umask=022

... and I launch vsftpd. I can login to FTP with user foo. However, I also can with other unix users! How can I disable other unix users?

3 Answers 3

29

In vsftpd.conf add:
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO

Edit the file to contain a username per row.

3
  • 2
    Worked for me too thanks. Worth noting that a userlist file already exists at /etc/vsftpd/user_list. However by default its in deny mode by userlist_deny=YES. So if you set userlist_deny=NO without either setting a new userlist_file or replacing the deny list in /etc/vsftpd/user_list with an accept list then you will have compromised your server security.
    – ekerner
    Nov 4, 2014 at 17:30
  • Worked like a charm.
    – Smeterlink
    Sep 7, 2022 at 18:20
  • @ekerner * user list config location is not at /etc/vsftpd/user_list, but at /etc/vsftpd.user_list Sep 13, 2023 at 8:41
4

there is a file in /etc/ftpusers put the allowed one only here.

no need to define in vsftpd

1
  • 6
    Didn't you got that one backwards? "list of users disallowed FTP access"
    – user65297
    Nov 25, 2013 at 23:05
0

add the user you want to deny to user_list list.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .