Vsftpd-2.0.1.tar.gz Installation notes-Linux Enterprise Application-Linux server application information, below is the details to read. 1. Install
Tar xzvf vsftpd-2.0.1.tar.gz
Cd vsftpd-2.0.1
Make
Make install
3. Edit the configuration file/etc/vsftpd. conf.
Add: listen = YES
4. Start the server
#/Usr/local/sbin/vsftpd &
Mkdir/var/ftp
Chmod og-w/var/ftp
5. if you want to only enable users in the/etc/ftpusers file, modify/etc/pam. d/ftp deny is allow; otherwise, the user in the file is forbidden to log on to the server.
6. Add a virtual user through pam Authentication
(1) Create an ftp file or modify the existing file in the/etc/pam. d/directory (if modified, comment out the original available items first)
[Root @ VSFTP root] # touch/etc/pam. d/ftp
(2) Add the following two lines in/etc/pam. d/ftp:
Auth required (/lib/security/) pam_userdb.so db =/etc/vsftpd_login
Account required (/lib/security/) pam_userdb.so db =/etc/vsftpd_login
Note: the path in the brackets may not exist.
(32.16create a system user name Password File login.txt
[Root @ VSFTP root] # vi login.txt
In the login.txt file, enter the following content. The following is the virtual user name and password of the ftp I added. tom is the user name, 123 is the password, jerry is the user name, and 123 is the password. The content can be customized as needed.
Tom
123
Jerry
123
(4) create a real user name vuser whose directory can be determined as needed or added by default.
[Root @ VSFTP root] # useradd vuser
(5) change the permissions of the/home/vuser directory so that other users (such as tom) can view the files in the directory upon logon.
[Root @ VSFTP root] # chmod o + r/home/vuser
(6) Create the database file of the virtual user through db_load. the original file to be used is the login.txt file created at the beginning.
[Root @ VSFTP root] # db_load-T-t hash-f login.txt/etc/vsftpd_login.db
(7) modify the vsftpd. conf file and add the following lines:
(Pam_service_name = ftp)
Guest_enable = YES
Guest_username = vuser
(Anon_world_readable_only = NO)
Note: It is best to set all anonymous options to NO.
(8) restart the vsFTPd server:/usr/local/sbin/vsftpd &
7. Change standalone to xinetd by default.
(1) create a file vsftpd in the/etc/xinetd. d/directory.
[Root @ VSFTP root] # touch/etc/xinetd. d/vsftpd
The content of/etc/xinetd. d/vsftpd is as follows:
Service ftp
{
Socket_type = stream
Wait = no
User = root
Server =/usr/sbin/vsftpd
# Server_args =
# Log_on_success + = DURATION USERID
# Log_on_failure + = USERID
Nice = 10
Disable = no
}
(2) Copy vsftpd. conf to the/etc/directory. Because the xinetd vsFTPd preparation file should be in the/etc directory, We must copy this file to the/etc directory, otherwise, the local user cannot log on to the system. That is to say, if the file is not copied, non-Anonymous ftp users cannot access the file, but anonymous users can only access the file.
[Root @ VSFTP root] # cp/etc/vsftpd. conf/etc/vsftpd. conf
(3) change the configuration file/etc/vsftpd. conf and note the following items:
Listen = YES
Change
# Listen = YES
Or delete this line.
(4) Delete the/etc/init. d/vsftpd file. In fact, it is best to back up data elsewhere, because sometimes we try to experiment, and it may be switched to standalone mode to start. I directly moved to another directory, such as the backup directory under/root.
[Root @ VSFTP root] # mkdir/root/backup
[Root @ VSFTP root] # mv/etc/init. d/vsftpd/root/backup
(5) Run ntsysv and cancel the vsftpd service
[Root @ VSFTP root] # ntsysv
[] Vsftpd
(6) restart the xinetd service
[Root @ VSFTP root] # service xinetd restart
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service