Setup FTP Server under Ubuntu/Debian
เก็บไว้ก่อน เดี๋ยวค่อยมาแปลและเขียนใหม่นะครับ
This article contains a brief introduction to set up an FTP-Server under Debian Linux. Activation of an FTP server should be done similarly with other distributions of Linux. Debian 5.0 (x86) was used as the test system.
Contents
- Installation of the required proftpd Package
- Adjusting the Configuration
- Anonymous FTP
- Re-loading the Configuration and Re-starting the FTP Server
- Links
Installation of the required proftpd Package
ProFTPd FTP-Server was used for this introduction because of its simply installation and configuration.
apt-get install proftpd
If the package cannot be found, update the local list of packages using:
apt-get update
If the package still cannot be installed after that, check the /etc/apt/sources.list on the appropriate Debian mirror server. You will find more information about this in the article Debian Mirror.
Indicate in the subsequent inquiry whether the FTP server should act as a standalone server (standalone) or as a service of inetd. In this example, the standalone option has been selected. Adjusting the Configuration
Our configuration assumes that we will login using system users found in the ftpuser group.
In order to adjust the configuration to your needs, edit the /etc/proftpd/proftpd.conf file.
If you are not using IPv6, this feature should be deactivated first:
UseIPv6 off
After that, we will add the following instruction at the end of the file:
<Global> RequireValidShell off </Global> DefaultRoot ~ ftpuser <Limit LOGIN> DenyGroup !ftpuser </Limit>
What do the instructions mean?
As a first step, we told ProFTPd that users wanting to login do not need a shell. Afterwards, we instructed ProFTPd to lock users in their home directory using DefaultRoot. Finally, we specified that only those users who are members of the ftpuser group could login.
We will now restart our FTP server so that our configuration takes effect:
/etc/init.d/proftpd restart
Then, we will create the ftpuser group and a first user that will be able to login.
addgroup ftpuser
Now, we create the user:
adduser ftpbenutzer -shell /bin/false -home /var/www
Finally, we assign the user to the ftpuser group:
adduser ftpbenutzer ftpuser
That’s everything. You should now be able to login with the user via FTP.
You have to run sudo deluser username groupname to delete a user from it's corresponding group. And run this sudo deluser --group groupname command to delete a group.
Anonymous FTP
By adding the following section to the etc/proftpd/proftpd.conf file, you will also give anonymous users (read) access to the FTP area:
. . . <Anonymous ~ftp> User ftp Group nogroup # We want clients to be able to login with "anonymous" as well as "ftp" UserAlias anonymous ftp # Cosmetic changes, all files belong to ftp user DirFakeUser on ftp DirFakeGroup on ftp RequireValidShell off # Limit the maximum number of anonymous logins MaxClients 10 # We want 'welcome.msg' displayed at login, and '.message' displayed # in each newly chdired directory. DisplayLogin welcome.msg DisplayFirstChdir .message # Limit WRITE everywhere in the anonymous chroot <Directory *> <Limit WRITE> DenyAll </Limit> </Directory> # # Uncomment this if you're brave. # # <Directory incoming> # # # Umask 022 is a good standard umask to prevent new files and dirs # # # (second parm) from being group and world writable. # # Umask 022 022 # # <Limit READ WRITE> # # DenyAll # # </Limit> # # <Limit STOR> # # AllowAll # # </Limit> # # </Directory> </Anonymous> . . .
To make sure, that user "ftp" is able to login anonymously to ftp-space, you have to add the user to the group "ftpuser":
adduser ftp ftpuser
Re-loading the Configuration and Re-starting the FTP Server
The configuration will have to be re-loaded after the adjustments to the /etc/proftpd/proftpd.conf file:
/etc/init.d/proftpd reload
Because the FTP server will be stopped when re-loading the configuration, it will also have to be re-started afterwards:
/etc/init.d/proftpd start
Links
- http://www.proftpd.org/ - Web site for the project
- http://www.castaglia.org/proftpd/ - Web site for the primary developer with numerous HOWTO pages and background information
Relate topics
- Ubuntu: จำกัดการเข้าถึง folder ของบาง user
- ddosify : Load Test - ไม่ผ่าน
- macOS 12 Monterey: Web Server Setup/Apache/MariaDB/PHP Multiple Versions
- Ubuntu Server Installation
- อีกที : macOS 11.0 Big Sur Apache/MiriaDB/PHP Setup
- Ubuntu Web Server Setup
- Apache Config on Ubuntu Server :: Manual add new site
- Check and Repair Hardisk
- Install AFP Share Server Protocal on Linux
- วิธีการติดตั้ง Let’s Encrypt automated free SSL certificate
- Linux Server Tools
- [Geek] Linux basic comamnds
- Make Macbook Pro to be Web Server
- พบบั๊ก GHOST ใน glibc ความร้ายแรงระดับสูง กระทบลินุกซ์รุ่นเก่าจำนวนมาก
- Server Setup : การกำหนดสิทธิ์ Root ให้กับ user บน Ubuntu 14.04
- ย้ายบ้านให้ MySql
- ใครกิน I/O ของข้า
- Debian : ปิดการตรวจสอบฮาร์ดดิสอัตโนมัติขณะเปิดเครื่อง
- Dabian bandwidth monitoring
- Install PhoneGap on Ubuntu