In the debian system, configure the proftp server-Linux Enterprise Application-Linux server application information. For more information, see. I chose proftpd because I used to use wu-ftpd, but I never fixed the problem with wu-ftpd. After I went crazy, I was on the road to installing proftpd!
ProFTPD is also open source software and is released with the GPL license. ProFTPD can be said to be an alternative to wu-ftpd, and has greatly improved security and scalability. Especially for those familiar with Apache configuration, its configuration is very similar to that of Apache, so it can be used with ease.
A single configuration file similar to Apache httpd. conf
The. ftpaccess file in each directory (similar to Apache. htaccess)
It is easy to configure multiple virtual FTP servers and anonymous FTP services.
Okay, let's talk about it. Let's get started:
Step 1.
# Apt-get install proftpd
Select inetd and then click OK. At this time, a common linux User can log on, and other users cannot log on, so we still have many settings to change!
First of all, you should come with me with the following idea:
Create the following folder:
/Home/china-net (this folder is specially used for FTP upload and download)
/Home/china-net/user1.com
/Home/china-net/user2.com
/Home/china-net/user3.com
Wait for my server user website folder!
The user group ftpadmin user ftpadmin is the Super administrator in/home/china-net.
User1, user2, and user3 of the ftpuser user group are
/Home/china-net/user *. com file corresponding!
2. After installation, two files will be generated
/Etc/proftpd. conf (main FTP configuration file)
/Etc/ftpusers (which is a user with FTP login prohibited)
3. At this time, we will establish FTP user groups and users.
# Groupadd ftpuser (this user group contains all FTP customers of our company)
# Useradd? G ftpuser-d/home/china-net/user1.com/-s/dev/null user1
# Useradd? G ftpuser-d/home/china-net/user1.com/-s/dev/null user2
# Useradd? G ftpuser-d/home/china-net/user1.com/-s/dev/null user3
(The preceding three commands are used to create a user, which is an FTP client)
# Passwd user1
Changing password for user echo
New UNIX password: user1
Retype new UNIX password: user1
Passwd: all authentication tokens updated successfully
Then, let our FTP users only log on to FTP and cannot TELNET.
In this way, user1 can only log on via ftp, but not via telnet.
Repeat the above command and then set the other two users user2 user3
After that, user1.com can be logged on. However, there are two problems:
A. Access the parent directory!
B. The uploaded files will not be shadow!
4. Solve the Problem of accessing the parent directory:
Add a sentence in the/etc/proftpd. conf file.
DefaultRoot/home/china-net
You can try FTP. /Home/china-net is your FTP root directory. You have the maximum permission to access it!
At this time, you can see that the problem of accessing the parent directory is basically solved.
But it is still not perfect. If we change it like this:
DefaultRoot ~ ! Admin
At this time, you are checking which user logs in to is its own root directory!
Okay. Here we will solve the problem of uploading failure.
5. Here we will add: The three commands chmod chgrp chown must be used skillfully! Otherwise, you cannot set up FTP!
# Groupadd ftpadmin
# Useradd? G ftpadmin? D/home/china-net ftpadmin? S/dev/null
# Chgrp? R ftpadmin/home/china-net (the parameter R contains all directories, and a group is added here)
# Chown? R ftpadmin/home/china-net (add user here)
6. A problem that cannot be uploaded has plagued me for a long time. Then I got some inspiration from it:
User ftp
Group nogroup
UserAlias anonymous ftp
MaxClients 10
DisplayLogin welcome. msg
DisplayFirstChdir. message
After this setting, anonymous FTP users can upload and download the content in the/home/ftp directory. However, the root directory is restricted under this file and cannot access the parent directory. This is exactly the permission that my user1 user should have! So I need to modify the settings.
AllowUser user1
# Cannot be deleted, renamed, or downloaded
DenyUser
OK!
When I wrote it here, my steps basically stopped here, and I just got off work. It takes one day!
Then I summarized that there are still many problems that have not been solved:
It is too difficult for a user to restrict upload in proftpd. conf? Should there be an ftpaccess file?
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service