FTP

Introduction to FTP

FTP is the English abbreviation of File Transfer Protocol , and the Chinese abbreviation is "Text Transfer Protocol". For bidirectional transfer of control files over the Internet . At the same time, it is also an application (Application). There are different FTP applications based on different operating systems, and all of them follow the same protocol to transfer files. In the use of FTP, users often encounter two concepts: "Download" and "Upload". "Downloading" a file means copying a file from a remote host to your own computer; "uploading" a file means copying a file from your own computer to a remote host. In Internet language, a user can upload (download) files to (from) a remote host through a client program.

The main function of FTP is to allow users to connect to a remote computer (the FTP server program is running on these computers), view the files in the remote computer, and then copy the files from the remote computer to the local computer, or transfer the files of the local computer to the remote computer. computer.

Small companies use FTP more, but large companies do not use FTP because it is not secure.

 

Use vsftpd to build ftp service

yum install -y vsftpd

useradd -s /sbin/nologin virftp vim /etc/vsftpd/vsftpd_login //The content is as follows, the odd number is the username, the even number is the password, multiple users write multiple lines

testuser1

aminglinux

chmod 600 /etc/vsftpd/vsftpd_login

db_load -T -t hash -f /etc/vsftpd/vsftpd_login /etc/vsftpd/vsftpd_login.db

mkdir /etc/vsftpd/vsftpd_user_conf

cd /etc/vsftpd/vsftpd_user_conf

 

 

mkdir /home/virftp/testuser1

touch /home/virftp/testuser1/aming.txt

chown -R virftp:virftp /home/virftp

vim /etc/pam.d/vsftpd //Add at the top

auth sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

account sufficient /lib64/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login

vim /etc/vsftpd/vsftpd.conf

Change anonymous_enable=YES to anonymous_enable=NO

Change #anon_upload_enable=YES to anon_upload_enable=NO

将#anon_mkdir_write_enable=YES 改为 anon_mkdir_write_enable=NO

Add the following

chroot_local_user=YES

guest_enable=YES

guest_username=virftp

virtual_use_local_privs=YES

user_config_dir=/etc/vsftpd/vsftpd_user_conf

allow_writeable_chroot=YES

 

systemctl start vsftpd //Start vsftpd service

 

 

xshell uses xftp to transfer files

download xftp

Log in to a terminal and use Ctrl+Alt+F to bring up xftp

Use pure-ftpd to build ftp service

yum install -y epel-release

yum install -y pure-ftpd

vim /etc/pure-ftpd/pure-ftpd.conf//Find the line pureftpd.pdb and delete the # at the beginning of the line

systemctl stop vsftpd

systemctl start pure-ftpd  mkdir /data/ftp

useradd -u 1010 pure-ftp

chown -R pure-ftp:pure-ftp /data/ftp

pure-pw useradd ftp_usera -u pure-ftp  -d /data/ftp

pure-pw mkdb

pure-pw list/userdel/usermod/passwd

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324453104&siteId=291194637
FTP