8. FTP: two types of text transmission mode and two types of ftp
I. Basic Knowledge
1. FTP is one of the TCP/IP protocol families, referred to as the file transfer protocol. It is mainly used for remote file transmission, such as file upload and download.
2. The following uses the VSFTP server as an example.
Users of VSFTP servers have three forms:
Anonymous user: the username is FTP or anonymous. The password is blank and the working directory is/var/ftp.
Local User: Linux User (but not the root user by default). The access root directory is the main directory of this user.
Virtual User: saves the user name and password in the database file or database server.
3. FTP text transmission modes include ASCII transmission mode (text mode) and binary transmission mode (binary)
ASCII transmission mode: This mode is suitable for text transmission. It can be automatically stored as a local text file when data of different types of operating systems are transmitted,
However, it is not suitable for transfer programs, databases, word processing files, compressed files, and other non-text files.
Binary transmission mode: Suitable for transferring programs, databases, word processing files, compressed files, and other non-text files
You can use the bin command on the FTP client to switch to the binary transmission mode,
Use the ascii command to switch to the ASCII Transmission Mode
2. download files in two modes
1. [root @ localhost root] # chkconfig -- list vsftpd (view the status of enabling vsftpd)
Vi/etc/vsftpd. conf
Ascii_upload_enable = YES
Ascii_download_enable = YES
(Remove the # sign in front of the two above) as shown in Figure
Service vsftpd restart
Disable vsftpd: [OK]
Start vsftpd For vsftpd: [OK]
Switch 4、to yanji,create word.txt
[Root @ localhost root] # su-yanji
[Yanji @ localhost yanji] $ cat> word.txt
First line
Row 2
Row 3
5. Start download
Method 1 (binary transmission mode)
In Windows Resource Manager, enter ftp: // 192.168.170.4/in the address bar and press Enter.
File-> log on, enter the account and password to log on (except for the root user)
No line breaks)
Go to disk D to view
Normal display
3. upload files in two modes
Upload the word.txt of the d drive to FTP
Command Line in windows (or in Linux)
Method 1 (binary transmission mode ):
In Windows Resource Manager, enter ftp: // 192.168.177.4 in the address bar and press Enter.
File-> log on, enter the account and password to log on (except for the root user)
Copy, paste, or drag an object.
However, in Linux
If word.txt encoding is not a UTF-8, it will be garbled
Style is also a problem
Method 2:
This result is the same as above.