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 use vsftpd software on FTP server

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article introduces how to use vsftpd software on FTP server, the content is very detailed, interested friends can refer to it, I hope it can be helpful to you.

Use of vsftpd software on FTP server

The Vsftpd software is the CentOS default FTP server. High speed, stable, download speed is twice as fast as WU-FTP

Ftp.redhat.com data: a single machine can support up to 15000 concurrency. Vsftpd is a software that comes with linux system.

Install vsftpd through yum:

1. Install the vsftpd service [10:26:42 root@A8 ~] # yum install vsftpd-y2 through yum, and view the file contained in vsftpd [10:27:03 root@A8 ~] # rpm-ql vsftpd/etc/vsftpd/vsftpd.conf # main configuration file / usr/lib/systemd/system/vsftpd.target # start service file

There will be a ftp user on the system even if the vsftpd service is not installed. And the home directory is under / var/ftp by default. So the anonymous login of ftp will be in the / var/ftp directory.

1. Find the ftp home directory [10:27:09 root@A8 ~] # getent passwd ftpftp:x:14:50:FTP User:/var/ftp:/sbin/nologin2, and enter the ftp home directory and you will have a pub folder. [10:28:57 root@A8 ~] # cd / var/ftp/ [10:29:35 root@A8 ftp] # lspub [10:29:37 root@A8 ftp] # ll pub/total 0

Start the ftp service:

1. Modify the ftp configuration file to support anonymous user login [10:54:48 root@A8 ftp] # vim / etc/vsftpd/vsftpd.confanonymous_enable=yes # default is NO We will enable anonymous 2 for other yes, start the ftp service [10:30:41 root@A8 ftp] # systemctl start vsftpd2, filter ftp by viewing port grep after starting the ftp service through grep filter port 2, and finally open the command channel of the ftp service. Because the command channel is port 21, and the listening user is ftp. But now the data channel will not be opened because there is no data transmission. So ftp users only listen to the 21 command channel port [10:32:59 root@A8 ftp] # ss-ntlp | grep ftpLISTEN 0 32 *: 21 *: * users: (("vsftpd", pid=2018,fd=3))

Use A7 as the host to act as the ftp service for the client link A8:

1. A7 client host downloads ftp client [10:39:37 root@a7 ~] # yum install ftp-y2, Link 10.0.0.8 FTP server [10:54:22 root@a7 ~] # ftp 10.0.0.8 Connected to 10.0.0.8 (10.0.0.8) .220 (vsFTPd 3.0.3) Name (10.0.0.8:root): ftp # log in to 331 Please specify the password.Password using anonymous user ftp: # do not fill in the password 230 Login successful. # prompt to log in successfully Remote system type is UNIX.Using binary mode to transfer files.ftp > ls # the file viewed here is the home directory file 227 Entering Passive Mode of the FTP user on the FTP server. 226117) .150 Here comes the directory listing.drwxr-xr-x 2006 Apr 24 03:01 pub # default FTP home directory pub file 226Directory send OK.ftp > cd pub # enter pub file Directory successfully changed.

Generate a f1.img file on the FTP server and have the A7 host download it:

1. Go to the ftp home directory of the A8 server and under the / pud directory [10:59:36 root@A8 ftp] # cd / var/ftp/pub/2, touch to generate a f1.img file [10:59:50 root@A8 pub] # touch f1.img [10:59:57 root@A8 pub] # lsf1.img

The f1.img file we just created can be viewed through ls on the A7 client host.

1. Because you did not quit the ftp server terminal just now, you can enter ls directly to see ftp > ls227 Entering Passive Mode. 136204) .150 Here comes the directory listing.-rw-r--r-- 1000 Jul 08 02:59 f1.img226 Directory send OK.ftp > get f1.img # then download f1.img to the A7 client native local: f1.img remote: f1.img227 Entering Passive Mode through the get command. # Link IP and random port 150 Opening BINARY mode data connection for f1.img (0 bytes) .226 Transfer complete.2 opened in passive mode. Default is download to root home directory [11:04:59 root@a7 ~] # ll f1.img-rw-r--r-- 1 root root 0 Jul 8 11:03 f1.img

2.5.2 now let's say that ftp's data channel active connection mode is another active mode switching instruction in the terminal of the ftp service.

Input? Displays commands for all ftp terminals.

The command Passive can be switched to active mode. By default, ftp services are passive mode links.

1 、 Connect to 10.0.0.8 FTP server via ftp [11:06:30 root@a7 ~] # ftp 10.0.0.8 Connected to 10.0.0.8 (10.0.0.8) .220 (vsFTPd 3.0.3) Name (10.0.0.8:root): ftp # enter anonymous user login 331 Please specify the password.Password: # password is empty direct enter 230Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp >? # enter? Instruction displays all ftp terminal commands Commands may be abbreviated. Commands are:! Debug mdir sendport site$ dir mget put sizeaccount disconnect mkdir pwd statusappend exit mls quit structascii form mode quote systembell get modtime recv suniquebinary glob mput reget tenexbye hash newer rstatus tickcase help nmap Rhelp tracecd idle nlist rename typecdup image ntrans reset userchmod lcd open restart umaskclose ls prompt rmdir verbosecr macdef passive runique? delete mdelete proxy sendftp > passive # enter the passive instruction Passive mode off. # the system prompts you to turn off passive mode (if you turn off passive mode, then switch to active mode) ftp > passive # enter the passive instruction Passive mode on again. # passive mode is enabled.

Pass in the FTP service terminal! Execute the local host LINUX command:

Ftp >! ls # pass! Followed by the command to view the local host file 1.txt Desktop Downloads initial-setup-ks.cfg Music Public Templatesanaconda-ks.cfg Documents f1.img initinstall.sh Pictures sadsad.sh Videosftp >! rm f1.img # delete the f1.img file ftp >! ls # check again that the f1.img file has been deleted 1.txt anaconda-ks.cfg Desktop Documents Downloads initial-setup-ks.cfg initinstall.sh Music Pictures Public sadsad.sh Templates Videos

Switch to active mode to download files:

After deleting it, we will now download the f1.img file again.

Now it does not display the ip of the ftp server and the random port of the link as it does in passive mode.

Instead, a port command is displayed. The Port command means that it is now in active link mode

Ftp > passive # enter the passive instruction Passive mode off. # turn off passive mode and naturally turn on active mode ftp > get f1.img # download f1.img file local: f1.img remote: f1.img200 PORT command successful. Consider using PASV. # download successfully through PORT mode

On the FTP server how to use vsftpd software to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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