20

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?

Vilican
  • 149
  • 1
  • 19
Istao
  • 303
  • 1
  • 2
  • 4

3 Answers3

28

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

Edit the file to contain a username per row.

Mark
  • 740
  • 5
  • 5
  • 1
    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 04 '14 at 17:30
  • Worked like a charm. – Smeterlink Sep 07 '22 at 18:20
4

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

no need to define in vsftpd

Sim
  • 81
  • 1
0

add the user you want to deny to user_list list.

usef_ksa
  • 805
  • 4
  • 11
  • 16