The FTP configuration in Linux is actually very simple, but in the actual configuration process, it is often unable to be accessed due to Linux-specific security issues. The following describes the ftp configuration that ignores all security issues. 1. run the rpm-qa | grepvsftpd command to check whether the ftp has been installed. if ftp is not installed, run yum-yinstallvsftpd to install it. 2. add an ftp account and directory, and check nolog first.
The FTP configuration in Linux is actually very simple, but in the actual configuration process, it is often unable to be accessed due to Linux-specific security issues. The following describes the ftp configuration that ignores all security issues.
1. run the rpm-qa | grep vsftpd command to check whether the ftp is installed. if ftp is not installed, run yum-y install vsftpd.
2. add an ftp account and Directory
First check the location of nologin, usually under/usr/sbin/nologin or/sbin/nologin.
Use the following command to create an account. the command specifies/alidata/www/wwwroot as the home directory of the ftpuser user. you can define the account name and directory by yourself:
# Useradd-d/var/ftp/ftpfile-s/sbin/nologin ftpuser
Modify the account password:
# Passwd ftpuser
Modify the permission of a specified directory
# Chown-R ftpuser. ftpuser/var/ftp/ftpfile
3. configure vsftp
To edit the vsftp configuration file, run the following command:
# Vi/etc/vsftpd. conf
Change "anonymous_enable = YES" in the configuration file to "anonymous_enable = NO"
Cancel the annotator before the following configuration:
Local_enable = YES
Write_enable = YES
Chroot_local_user = YES
Save the modification, press ESC, and enter: wq
4. modify shell configuration
Vi edit/etc/shells. if the file does not contain/usr/sbin/nologin or/sbin/nologin (depending on the current system configuration), append it
5. start vsftp and test logon.
Run the following command to start the vsftp service:
# Service vsftpd start
Then, use the account pwftp to test whether ftp can be logged on. The directory is/var/ftp/ftpfile.
Linux ftp cannot be accessed in the actual process. We can disable the firewall and other security monitoring services (preferably open port 21 in actual enterprise applications)
1. disable the firewall.
Service iptables stop
2. disable SELinux.
To modify the configuration file, restart the machine:
Modify the/etc/selinux/config file
Change SELINUX = enforcing to SELINUX = disabled
Restart the machine.
3. vftpd boot:
Modify rc. local file 2:
Modify/etc/rc. local and add/etc/rc. d/init. d/vsftpd start