Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up a special communication account for Proftpd

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces Proftpd how to establish a special exchange account, the article introduces in great detail, has a certain reference value, interested friends must read it!

Proftpd set up a special communication account (set up a ftpguest group! Set all guset in this group!

I think many friends have the experience of using FTP sites to communicate with other web sites! It's really great that you can grant some stations the right to upload and download, and these rights can be retained or cumbersome. Server-U is a good guy on the Windows system, so can our FTP on Linux achieve this function? He he! Proftpd is fine! And the settings are really simple! Suppose we want to achieve this function:

The host environment, the actual consumer environment and the anonymous environment are all the same as those of the previous models.

Create a group named ftpguest. If the user belongs to this group, his root directory will be under / var/ftp2 after the user logs in to the host.

There are three users, named ftpuser1, ftpuser2 and ftpuser3, who belong to the ftpguest group. They do not have a home directory and cannot use ssh, but they have access rights in / var/ftp2/upload, but they cannot access data.

In all related downloads within / var/ftp2, * traffic is 50 Kbytes/second

The upload / download ratio of ftpuser1 is 1:2 and has the default download of 100 MB, while the upload / download ratio of ftpuser2 to ftpuser3 is 1:1, which only has the default download of 30MB.

When a user enters / var/ftp2, it will show the upload / download ratio of the user, as well as the remaining download capacity, as well as other related messages

The upload / download ratio related to the user and the remaining downloadable capacity are recorded in / var/ftp2/work/ratio.dat, / var/ftp2/work/ratio.tmp, so the user cannot write or write in this directory!

In this case, the most important thing is the ratio uploaded / downloaded by the record user and the log file of available space. In my case, the file / var/ftp2/work/ratio.dat is used. Please note that this file must be accessible and written by ftpuser1, ftpuser2, and ftpuser3! It's important to be equal. So, I should design my profile like this:

1. Create the required groups and users:

# I want to set up a group as ftpguest, in addition, all related users are in this group!

[root@test root] # groupadd ftpguest

[root@test root] # useradd-M-g ftpguest-s / bin/false ftpuser1

[root@test root] # useradd-M-g ftpguest-s / bin/false ftpuser2

[root@test root] # useradd-M-g ftpguest-s / bin/false ftpuser3

[root@test root] # passwd ftpuser1

# Please create the password of ftpuser1 ftpuser2 ftpuser3 in order!

two。 Establish the required FTP related paths:

# the path I want is in / var/ftp2, and ftpguest must be able to access it!

[root@test root] # mkdir-p / var/ftp2

[root@test root] # mkdir-p / var/ftp2/upload

[root@test root] # mkdir-p / var/ftp2/work

[root@test root] # chmod-R 775 / var/ftp2

[root@test root] # touch / var/ftp2/work/ratio.dat # two files are used in ratio

[root@test root] # touch / var/ftp2/work/ratio.tmp

[root@test root] # chown-R ftpuser1:ftpguest / var/ftp2

[root@test root] # chmod 666 / var/ftp2/work/*

3. Create a basic profile:

[root@test root] # vi / usr/local/proftpd/etc/proftpd.conf

# as for the host, the actual usage, the anonymous settings are shown in the previous guide, so I'll skip it here!

... Follow the settings of the mini bar, which is omitted here.

# below is the configuration of / var/ftp2! It is the settings related to ftpguest!

DefaultRoot / var/ftp2 ftpguest

DisplayLogin welcome.msg

# start to set the upload / download ratio

Ratios on

SaveRatios on

RatioFile / work/ratio.dat

RatioTempFile / work/ratio.tmp

# the above two files need to be paid more attention! His path has something to do with DefaultRoot!

# because our DefaultRoot is in / var/ftp2, so this file is in

# "when the root is / var/ftp2, the road is / work/", that is to say, / work/ratio.dat

# the truth is / var/ftp2/work/ratio.dat (because / is / var/ftp2)

# this place is the easiest to mess with! Please take a good look at it again! ^ _ ^

# the following setting is to make the files under the / var/ftp2/work directory unusable!

Denyall

# this is setting the user's upload / download ratio! The method is:

# UserRatio "user account" fileratio filequota byteratio bytequota

# user account: it is the account that logs in to proftpd!

# fileratio: this is a file-based "proportion", which is usually unlimited, so it is 0

# filequota: how many files can be downloaded by default, and the unlimited time is 0

# byteratio: the ratio of uploads / downloads. This number means "1: downloads"!

# bytequota: how many KBytes files can be downloaded by default! Pay attention to the unit!

UserRatio ftpuser1 00 2 100000 # up / down ratio is 1:2

UserRatio ftpuser2 00 1 30000

UserRatio ftpuser3 00 1 30000

# UserRatio ftpuser3 00-2 30000

# the above line is interesting! When the down ratio is low, it means that the up / down ratio is 2:1!

Umask 002

# this is the "downloading speed limit"!

TransferRate RETR 50 group ftpguest

Denyall

Allowall

4. Establish the "welcome" side:

# especially note that since the root directory of my ftpguest group is in / var/ftp2, my

# welcome.msg must be placed on / var/ftp2/welcome.msg!

[root@test root] # vi / var/ftp2/welcome.msg

Welcome the light! This is my brother's test FTP platform!

My host:% L

Current time:% T

* connection:% M

Current connection:% N

Your host:% R

Your account:% U

Current directory:% C

5. Restart!

[root@test root] # / etc/rc.d/init.d/xinetd restart

The above is all the contents of the article "how to set up a Special Communication account in Proftpd". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report