Article Title: nainiao script set up on SFTPD Server. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Simple VSFTPD server construction 1. Are you sure you want to install VSFTPD software: # rpm? Qa | grep vsftpd 2. start the FTP server: # service vsftpd start 3. The default FTP directory is/var/ftp/pub 4.FTP 127.0.0.1 for anonymous testing. name: anonymous pass:
Welcome to create further FTP server configuration: 1. open/etc/vsftpd. conf file 2. change dirmessage_enable to YES 3. create a message text file in your FTP directory, and enter the welcome word.
Change the default port of the FTP server: 1. Open the vsftpd. conf file. 2. Add the following content in the last line of the file: listen_port = 2121. Change the default port 21 to 2121.
Cancel Anonymous Logon: change the value of Anonymous to NO in the vsftpd. conf file.
The user cannot change the Directory: Find the following three lines in vsftodd. conf # chroot_list_enable = YES # (default follows)
# Chroot_list_file =/etc/vsftpd. chroot_list
Change it to: # chroot_list_enable = YES # (default follows)
Chroot_list_file =/etc/vsftpd/chroot. list adds a new file:/etc/vsftpd/chroot_list. The file content is the user name to log on.
Note: After modification, You need to RESTART the FTP server, SERVICE VSFTPD RESTART
When you change the directory, the system will prompt you: Failed to change directory
FTP configuration for virtual users
Features of a virtual user: only the FTP service provided by the server can be accessed, but other resources of the system cannot be accessed.
Virtual users: to improve system security.
1. Create a virtual user password library file and create one. TXT file, in the format of: singular behavior name, even behavior pssword
2. Generate a password library file and modify the File Permissions
Note: before using the following command, you must first install the Berkeley db Program # db_load? T-t hash-f account.txt/etc/vsftpd/account. db # chmod 600/etc/vsftpd/account. db
3. create a virtual user's PAM file and add the following two sentences: # vi/etc/pam. d/vsftp. vu auth required/lib/security/pam_userdb.so db =/etc/vsftpd/account
4. Create a virtual user, set the directory to be accessed by the user, and set the access permission for the virtual user: # useradd? D/ftp virtual_user # chmod 700/ftp
Now the virtual user has been set up. Note: you must go to/etc/vsftpd. add the following two statements in the conf file: guest_username = virtual guest_enable = YES pam_service_name = vsftp. the configuration file of the PAM file specified by vu is vsftp. vu