快轉到主要內容

Build a FTP Server with 「vsftpd」

·343 字
Computer-Science FTP
目錄

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:
      root, 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.

相關文章

Raspberry Pi 4 (Ubuntu) configure auto connect to wifi
·142 字
Computer-Science Raspberry PI Wi-Fi Ubuntu

How to make ubuntu auto connect to wifi in raspberry pi 4?

Linux + Win 雙系統卻不見 Grub 開機選單?
·1691 字
Computer-Science Windows Ubuntu Grub

安裝了 Linux + Windows 的雙系統,但卻不見開機選單?放心,很多人跟你一樣。

Simply setting up a Proxy Server with SSH
·344 字
Computer-Science SSH

Did you know that SSH can make your host as a proxy server?

How to use GnuPG to sign files and messages?
·1769 字
Computer-Science Cryptography PGP

用 GnuPG 簽署、驗證、加密、解密 你的檔案及訊息。

How to use GnuPG to generate PGP key?
·1393 字
Computer-Science Cryptography PGP

怎麼使用 GnuPG 生成 PGP 金鑰?

《SQL Basics-03》UPDATE、ALTER、DROP
·907 字
Computer-Science SQL Database

一些基礎常見的 SQL 語法。