create account

Learn Linux Series (#2) - Proftpd management and configuration by vitusc

View this thread on: hive.blogpeakd.comecency.com
· @vitusc · (edited)
$27.62
Learn Linux Series (#2) - Proftpd management and configuration
**Learn Linux Series (#2) - Proftpd management and configuration**
https://steemitimages.com/0x0/https://habrastorage.org/getpro/habr/post_images/9e3/d19/948/9e3d19948ac4132613bf784ef7c7d229.png
#### What Will I Learn?
- What is proftpd
- How to install Proftpd
- How to configure Proftpd
- Starting, restarting and stopping the server
- Restrictions about IP and hosts from which you can log in
- Logging in as an anonymous user to the server
- Server load constraints
- Troubleshooting ProFTPD

#### Requirements
- Linux system installed
- Basic knowledge of terminal operation
- Average knowledge of linux commands
- Motivation when something goes wrong

#### Difficulty
Intermediate
<br>
<center>
https://bmat.pl/wp-content/uploads/2015/02/proftpd.jpg
<br>
**Learn Linux Series (#2) - Proftpd management and configuration**
<br>
- **What is proftpd**
<br>
</center>
FTP allows you to transfer files between a server computer and a client computer.

The connection via the FTP protocol can work in two modes:

     active
     passive.

In active mode, FTP uses port 21 for commands and port 20 for data transfer. In passive mode, FTP uses port 21 for commands and a port number above 1024 for data transmission.
<br>
- **Proftpd Installation**
<br>
In the terminal, we must execute the command to download the proftpd software.
To do this, enter the command:
``` language
apt-get install proftpd
```
<br>
if a message pops up that we do not have administrator rights, we must execute the command:
``` language
sudo -s
```
(this command gives us administrator privileges, and keeps them at all times while the terminal is running).
After downloading the software, it's time to launch it.<br>
- **Starting, restarting and stopping the server**<br>
We will need these commands:<br>
Server launch:
``` language
/etc/init.d/proftpd start
```
Message that should appear when the Proftpd server is successfully started:
![poprawny.png](https://res.cloudinary.com/hpiynhbhq/image/upload/v1520510847/taaja3mqmhcfueff2tby.png)

Server restart:
``` language
/etc/init.d/proftpd restart
```
Server stop:
``` language
/etc/init.d/proftpd stop
```
If we already know how to install, run, disable, restart the server, then we have to get to the configuration.
<br>
- **Proftpd configuration**<br>
The basic configuration file is /etc/proftpd.conf<br>
The simplest, enabling the server to work properly, the configuration file is:

``` language
ServerName   "utopian"
ServerAdmin   email@utopian.admin
ServerType   standalone
DefaultServer   on
DefaultRoot   ~
Port    21
Umask    002
User    utopian   
Group    utopian
```
<br>
- **Restrictions about IP and hosts from which you can log in**<br>
Sometimes it happens that we have to set access restrictions to the server.
Limitations can be determined in two ways.
<br>
Method 1:<br>
By default, let everyone in, except for some addresses.<br>
``` language
&lt;Limit LOGIN&gt; 
     Order allow,deny
     Deny from c.utopian.io
     Deny from p.utopian2.io
     &lt;/Limit&gt;
```
Computers from "Deny from" will not be allowed into the server. All others will be let in.
<br>
Method 2:<br>
By default, allow selected people, and the rest do not allow.<br>
``` language
&lt;Limit LOGIN&gt; 
 Order deny,allow
 Allow from c.utopian.io
 &lt;/Limit&gt;
```
Only computers entered in "Allow from" will be allowed to the server.<br>
- **Logging in as an anonymous user to the server**<br>
Anonymous is a special user that have allowed access to public server resources. We can log in without entering the password and freely download the software available.
An example configuration of an anonymous account:
``` language
User    ftp    - user
Group    ftp  - group
AnonRequirePassword          off  - loggining without password
UserAlias   anonymous ftp    - user's aliases
DisplayLogin   .welcome.msg   - welcome message
DisplayFirstChdir  .message  -message that appears after entering the catalog
GroupOwner                    ftp   
Umask                         002     

&lt;Limit  WRITE&gt;     
DenyAll    
&lt;Limit&gt;       

&lt;Limit  READ DIRS&gt;      
IgnoreHidden  on     
&lt;Limit&gt;   
```
<br>
- **Server load constraints**<br>
It happens that the traffic on the server is so big, it overloads the server so much that it can not be operated. In this case, we need to introduce server load constraints. 
We use two commands for this:<br>
``` language
MaxClients
```
and
``` language
MaxClientsPerHost
```
Sample configuration:
``` language
MaxClients 100 "There are currently too many people on the utopian server, try again later!"

MaxClientsPerHost 12 "You have too many open connections, you can not enter to utopian."
```
<br>
- **Troubleshooting ProFTPD**<br>
Error messages can be found in
``` language
/var/log/proftpd/proftpd.log
```
by default, if the Proftpd server does not work after installation, you can check this file.
Sometimes, the server is delayed and you can not access the server. The message "Connection refused" will then pop up. It is not a problem. You must restart the ProFTPD server until it works.
<br>
Default log message if everything is okay:
``` language
2018-03-08 13:04:35,072 vitusc-utopian proftpd[2205] vitusc-utopian: ProFTPD 1.3.5d (maint) (built Thu Ja$
```

#### Curriculum
[Part 1 - TCP/IP Computer Adaptation](https://utopian.io/utopian-io/@vitusc/learn-linux-series-1-tcp-ip-computer-adaptation)
    

<br /><hr/><em>Posted on <a href="https://utopian.io/utopian-io/@vitusc/learn-linux-series-2-proftpd-management-and-configuration">Utopian.io -  Rewarding Open Source Contributors</a></em><hr/>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 85 others
properties (23)
authorvitusc
permlinklearn-linux-series-2-proftpd-management-and-configuration
categoryutopian-io
json_metadata"{"community":"utopian","app":"utopian/1.0.0","format":"markdown","repository":{"id":2325298,"name":"linux","full_name":"torvalds/linux","html_url":"https://github.com/torvalds/linux","fork":false,"owner":{"login":"torvalds"}},"pullRequests":[],"platform":"github","type":"tutorials","tags":["utopian-io","utopian-io","steemit","promo-steem","linux"],"users":["utopian.admin","vitusc"],"links":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1520510847/taaja3mqmhcfueff2tby.png","https://utopian.io/utopian-io/@vitusc/learn-linux-series-1-tcp-ip-computer-adaptation"],"image":["https://res.cloudinary.com/hpiynhbhq/image/upload/v1520510847/taaja3mqmhcfueff2tby.png"],"moderator":{"account":"cha0s0000","time":"2018-03-08T14:05:04.237Z","reviewed":true,"pending":false,"flagged":false},"questions":[{"question":"Is the project description formal?","answers":[{"value":"Yes it’s straight to the point","selected":true,"score":10},{"value":"Need more description ","selected":false,"score":5},{"value":"Not too descriptive","selected":false,"score":0}],"selected":0},{"question":"Is the language / grammar correct?","answers":[{"value":"Yes","selected":true,"score":20},{"value":"A few mistakes","selected":false,"score":10},{"value":"It's pretty bad","selected":false,"score":0}],"selected":0},{"question":"Was the template followed?","answers":[{"value":"Yes","selected":true,"score":10},{"value":"Partially","selected":false,"score":5},{"value":"No","selected":false,"score":0}],"selected":0},{"question":"Is there information about the additional frameworks?","answers":[{"value":"Yes, everything is explained","selected":false,"score":5},{"value":"Yes, but not enough","selected":true,"score":3},{"value":"No details at all","selected":false,"score":0}],"selected":1},{"question":"Is there code in the tutorial?","answers":[{"value":"Yes, and it’s well explained","selected":true,"score":5},{"value":"Yes, but no explanation","selected":false,"score":3},{"value":"No","selected":false,"score":0}],"selected":0},{"question":"Is the tutorial explains technical aspects well enough?","answers":[{"value":"Yes, it teaches how and why about technical aspects","selected":false,"score":5},{"value":"Yes, but it’s not good/enough","selected":true,"score":3},{"value":"No, it explains poorly","selected":false,"score":0}],"selected":1},{"question":"Is the tutorial general and dense enough?","answers":[{"value":"Yes, it’s general and dense","selected":false,"score":5},{"value":"Kinda, it might be more generalized","selected":true,"score":3},{"value":"No, it’s sliced unnecessarily to keep part number high","selected":false,"score":0}],"selected":1},{"question":"Is there an outline for the tutorial content at the beginning of the post","answers":[{"value":"Yes, there is a well prepared outline in “What will I learn?” or another outline section","selected":true,"score":5},{"value":"Yes, but there is no proper listing for every step of the tutorial or it’s not detailed enough","selected":false,"score":3},{"value":"No, there is no outline for the steps.","selected":false,"score":0}],"selected":0},{"question":"Is the visual content of good quality?","answers":[{"value":"Yes","selected":true,"score":5},{"value":"Yes, but bad quality","selected":false,"score":3},{"value":"No","selected":false,"score":0}],"selected":0},{"question":"Is this a tutorial series?","answers":[{"value":"Yes","selected":true,"score":5},{"value":"Yes, but first part","selected":false,"score":3},{"value":"No","selected":false,"score":0}],"selected":0},{"question":"Is the tutorial post structured?","answers":[{"value":"Yes","selected":true,"score":5},{"value":"Not so good","selected":false,"score":3},{"value":"No","selected":false,"score":0}],"selected":0}],"score":65}"
created2018-03-08 12:13:45
last_update2018-03-08 14:05:03
depth0
children3
last_payout2018-03-15 12:13:45
cashout_time1969-12-31 23:59:59
total_payout_value19.236 HBD
curator_payout_value8.379 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,597
author_reputation1,946,343,431,111
root_title"Learn Linux Series (#2) - Proftpd management and configuration"
beneficiaries
0.
accountutopian.pay
weight2,500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id43,097,846
net_rshares8,657,828,917,723
author_curate_reward""
vote details (149)
@cha0s0000 ·
Thank you for the contribution. It has been approved.   
- What you talk in the tutorial is so simple that I nearly want to reject it .But considering your own thought of the tutorials .  
- Hope for your more quality work instead of simple and easy ones

You can contact us on [Discord](https://discord.gg/uTyJkNm).
**[[utopian-moderator]](https://utopian.io/moderators)**
properties (22)
authorcha0s0000
permlinkre-vitusc-learn-linux-series-2-proftpd-management-and-configuration-20180308t140621309z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"community":"utopian","app":"utopian/1.0.0"}
created2018-03-08 14:06:21
last_update2018-03-08 14:06:21
depth1
children1
last_payout2018-03-15 14:06:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length373
author_reputation30,983,518,016,225
root_title"Learn Linux Series (#2) - Proftpd management and configuration"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id43,117,749
net_rshares0
@vitusc ·
Thanks a lot for approve. Can you tell me what do you think about my part 1?
properties (22)
authorvitusc
permlinkre-cha0s0000-re-vitusc-learn-linux-series-2-proftpd-management-and-configuration-20180308t170751249z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-08 17:07:51
last_update2018-03-08 17:07:51
depth2
children0
last_payout2018-03-15 17:07:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length76
author_reputation1,946,343,431,111
root_title"Learn Linux Series (#2) - Proftpd management and configuration"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id43,152,241
net_rshares0
@peancy ·
Thank you for the next tutorial on the linux system.
properties (22)
authorpeancy
permlinkre-vitusc-learn-linux-series-2-proftpd-management-and-configuration-20180308t125630052z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-03-08 12:56:33
last_update2018-03-08 12:56:33
depth1
children0
last_payout2018-03-15 12:56:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length52
author_reputation1,834,452,363
root_title"Learn Linux Series (#2) - Proftpd management and configuration"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id43,105,793
net_rshares0