Linux Tutorials - Herong's Tutorial Examples - v5.45, by Herong Yang
Test FTP Access Locally on CentOS
This section provides a tutorial example on how to use the 'ftp' client program to access the 'vsftpd' server locally on the same CentOS computer.
After updating vsftpd configuration and setting up my "ftp" home directory, now I am ready to test my FTP access locally on the same CentOS computer as the vsftpd server.
1. Make sure the "ftp" client program is available.
herong$ dnf info ftp Last metadata expiration check: 6:29:59 ago on Tue 07 Jul 2020 11:12:35 PM EDT. Available Packages Name : ftp Version : 0.17 Release : 78.el8 Architecture : x86_64 Size : 112 k Source : ftp-0.17-78.el8.src.rpm Repository : @System From repo : AppStream Summary : The standard UNIX FTP (File Transfer Protocol) client URL : ftp://ftp.linux.org.uk/pub/linux/Networking/netkit License : BSD with advertising Description : The ftp package provides the standard UNIX command-line FTP (File : Transfer Protocol) client. FTP is a widely used protocol for : transferring files over the Internet and for archiving files. : : If your system is on a network, you should install ftp in order to do : file transfers. herong$ sudo dnf install ftp ... Downloading Packages: ftp-0.17-78.el8.x86_64.rpm 373 kB/s | 70 kB 00:00 Installed: ftp-0.17-78.el8.x86_64 Complete!
2. Connect to FTP server locally:
herong$ ftp localhost Trying ::1... Connected to localhost (::1). 220 (vsFTPd 3.0.3) Name (localhost:herong): herong 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> dir 229 Entering Extended Passive Mode (|||30675|) 150 Here comes the directory listing. drwxr-xr-x 2 1000 1000 6 Jun 23 09:08 files 226 Directory send OK.
3. Upload a text file to the ./files sub-directory. Do not upload any files to the FTP home directory, which is configured only for the vsftpd daemon to access.
ftp> put test.txt local: test.txt remote: test.txt 229 Entering Extended Passive Mode (|||30283|) 150 Ok to send data. 226 Transfer complete. 637 bytes sent in 4e-05 secs (15925.00 Kbytes/sec) ftp> dir 229 Entering Extended Passive Mode (|||30217|) 150 Here comes the directory listing. -rw-r--r-- 1 1000 1000 637 Jul 11 10:03 test.txt 226 Directory send O ftp> cd .. 250 Directory successfully changed. ftp> put test.txt local: test.txt remote: test.txt 229 Entering Extended Passive Mode (|||30871|) 553 Could not create file. ftp> exit 221 Goodbye.
4. Check log file. It could be /var/log/xferlog or /var/log/xferlog:
herong$ sudo tail /var/log/xferlog ... 1 ::ffff:192.168.1.11 0 /some.pdf b _ i r joe ftp 0 * i herong$ sudo tail /var/log/vsftpd.log ... [pid 21901] CONNECT: Client "::ffff:192.168.1.11" ... [pid 21900] [herong] OK LOGIN: Client "::ffff:192.168.1.11" ... [pid 21969] [herong] OK UPLOAD: Client "::ffff:192.168.1.11", "/files/test.txt", 3547 bytes, 218.68Kbyte/sec
Cool! vsftpd daemon is working locally now. See the next tutorial on how to option the firewall for users to do FTP remotely.
Table of Contents
Cockpit - Web Portal for Administrator
SELinux - Security-Enhanced Linux
SSH Protocol and ssh/scp Commands
Software Package Manager on CentOS - DNF and YUM
►vsftpd - Very Secure FTP Daemon
Setup FTP Sub-Directory for Local Users
►Test FTP Access Locally on CentOS
Test FTP Access Remotely on CentOS
Support FTP Over TLS on CentOS
Disable SSH Access for FTP Users