Today, we have set up the FTP service as needed. here we need to note that there are differences between the RedHat in centos and Linux. I have done and studied it myself, and I will talk about some of the learning points, if any error occurs, please advise;
First, set up the vsftpd service: the installation package.
Rpm-IVH/var/FTP/centos/vsftpd-2.0.5-12.el5.x86_64.rpm (the default path of the package is under/Media/CDROM/centos/), just install
Because it was a virtual user, it went straight to the topic .. Haha
1. First, vi a text document, The username and password are the odd lines.
From the beginning, I wrote lonin.txt, which is the name and password of our virtual account .,
Frank
Coolbar1 !. 0
Sanguo
Sanguo
2. Virtual users need a database transformation, dependent on package db4, db4-utils, db4-devel
Db4-devel-4.3.29-9.fc6
Db4-4.3.29-9.fc6
Db4-utils-4.3.29-9.fc6
3. convert our documents into databases .,, This is important
Db_load-T-t hash-F lonin.txt/etc/vsftpd/vsftpd_login.db
In this case, chmod 700/etc/vsftpd/vsftpd_login.db prohibits other users from viewing users in the database. Security is very important.
4. Add PAM Authentication. Installation package required
Pam-devel-0.99.6.2-4.el5
Pam-0.99.6.2-4.el5
Pam_pkcs11-0.5.3-23
Edit/etc/PAM. d/vsftpd.
[Root @ localhost ~] # Cat/etc/PAM. d/vsftpd
# % PAM-1.0
Auth sufficient/lib/security/pam_userdb.so DB =/etc/vsftpd/vsftpd_login
Account sufficient/lib/security/pam_userdb.so DB =/etc/vsftpd/vsftpd_login
These two lines are placed in the file header, and the parameters are different from those of Linux Redhat,
Create a virtual account, useradd-D/home/ftpsite/vritual
Note that the directory uploaded by your virtual account must be in home/ftpsite. Otherwise, you will be prompted for incorrect password or OPS error.
In this case, OK... The following is how to edit vsftpd. conf.
I will not explain the reason for editing the file ..
Anonymous_enable = No
Local_enable = Yes
Write_enable = Yes
Local_umask = 022
Dirmessage_enable = Yes
Xferlog_enable = Yes
Connect_from_port_20 = Yes
Xferlog_file =/var/log/vsftpd. Log
Xferlog_std_format = Yes
Ascii_upload_enable = Yes
Ascii_download_enable = Yes
Listen = Yes
Guest_enable = Yes
Guest_username = Virtual
Pam_service_name = vsftpd
User_config_dir =/etc/vsftpd/user_conf
Virtual_use_local_privs = Yes
Then we need to edit the virtual account permissions in/etc/vsftpd/user_conf.
So my virtual user Frank
Local_root =/home/ftpsite/Sanguo
Write_enable = Yes
Anon_world_readable_only = Yes
Anon_upload_enable = Yes
Anon_mkdir_write_enable = Yes
Anon_other_write_enable = Yes
In this way, you can log on with the frank user.
[Root @ localhost user_conf] # ftp 192.168.2.46
Connected to 192.168.2.46.
220 (vsftpd 2.0.5)
530 please login with user and pass.
530 please login with user and pass.
Kerberos_v4 rejected as an authentication type
Name (192.168.2.46: Root): Frank
331 please specify the password.
Password:
230 login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
In this case, OK. If you have any questions or do not have any effect, you can add the QQ group: 140704742
Thank you.
From: http://www.linuxdiyf.com/viewarticle.php? Id = 203796