快轉到主要內容

Build a FTP Server with 「vsftpd」

·343 字· loading · loading ·
目錄

How to build the FTP Server quicly with 「vsftpd」?


Install service 「vsftpd」
#

In ubuntu, you just need to run the following command for installation:

1apt-get install vsftpd -y

Configure the vsftpd
#

You can find the config file of vsftpd in /etc/vsftpd.conf or /etc/vsftpd/vsftpd.conf probably.

There have many settings, but mostly the options you only need to care are below:

  • anonymous_enable - If you want that the ftp is allow to connect by anonymous user, change it to YES.(NOT Recommended)
  • write_enable - Set it to YES to make the user writeable.
  • allow_writeable_chroot - Set it to YES to allow the user writeable in home directory.
  • chroot_local_user - When the option is set to YES, it means that the user can only access their home directory.
  • chroot_list_enable, chroot_list_file - These options usually work with chroot_local_user as an exception.
    • If chroot_local_user=YES
      • If chroot_list_enable=YES - This means all users are restricted to their home directory except the users in chroot_list_file.
      • If chroot_list_enable=NO - This means all users are restricted to their home directory and no exception.
    • If chroot_local_user=NO
      • If chroot_list_enable=YES - This means all users are NOT restricted to their home directory except the users in chroot_list_file.
      • If chroot_list_enable=NO - This means all users are NOT restricted to their home directory and no exception.
    • chroot_list_file=/etc/vsftpd/chroot_list - This option is setting where the chroot list file is, and the content of file looks like following:
      1root, user1, user2
  • pam_service_name=ftp - The default value is vsftpd, but if you are setting the shell /usr/sbin/nologin to the ftp users, it’s gonna be not working probably. (ps. pls search by google for details)
  • userlist_enable - If set it to YES means can only the specific users be login in vsftpd.
  • userlist_deny - Opposite of userlist_enable option, if set it to YES means all users are allow to login in vsftpd except the specific users.
  • userlist_file=/etc/vsftpd/user_list - Setting where is the file for specific users in two above options.

Restart the service
#

Don’t forget to restart the service so it can run in the new configuration.

1service vsftpd restart
Alpaca
作者
Alpaca
No one can stop my feet.

相關文章