Red Hat Linux Installing VSFTP

Learn about the Red Hat Linux

First, the installation partition scheme:

(1) swap partition, twice the memory

(2) / boot partition

(3) / all of the remaining space

Language Selection English (English)

Second, configure IP

IP address, subnet mask:

Edit / etc / sysconfig / network-script / ifcfg-eth0

DEVICE = eth0

BOOTPROTO = static – static or dynamic


IPADDR = -IP address

NETMASK = – Subnet Mask

NETWORK = – Network ID

ONBOOT = yes


Edit / etc / sysconfig / network


HOSTNAME = vmlinux — hostname

GATEWAY = — Gateway


Edit /etc/resolv.conf



Note: The above IP address must be changed with your network configuration corresponding IP address. “” In front of attention to the case.

MAC address changes under RedHat Linux

1. You must first turn off the network card device, otherwise it will report the system is busy, can not be changed.

/ Sbin / ifconfig eth0 down

2. Modify the MAC address.

/ Sbin / ifconfig eth0 hw ether 00¦ŸAA¦ŸBB¦ŸCC¦ŸDD¦ŸEE

3. Re-enable the network card

/ Sbin / ifconfig eth0 up

NIC’s MAC address change is complete.

Another approach is to modify the network card configuration file ifcfg-ethx, add the MAC address format similar to: HWADDR = 00: AA: BB: CC: DD: EE.

Third, configure the server to configure vsftpd

Installation and Startup

1. using the following command to check whether you have installed:

#rpm -qa | grep vsftpd


If the above result appears indicating that installation. If not, the installation package can be found in the Red Hat Enterprise Linux5 installation CD-ROM, use the command:

vsftp-2.0.5-10.e15.i386.rpm located in the second file iso

#mount / dev / cdrom / mnt / cdrom

#rpm -ivh vsftp-2.0.5-10.e15.i386.rpm

2. Startup and Shutdown

Start command: #service vsftpd start

Stop command: #service vsftpd stop

Reboot command: #service vsftpd restart

Running status: #service vsftpd status

vsftpd (pid 3571) in progress ……

3, Vsftpd server configuration

Vsftpd there are three main configuration file:




Before the proposed changes cp command to back up three files, modify the need to restart the vsftpd service after the completion of the settings to take effect.

(A) anonymous user access configuration

1. Start FTP server can be landed

Anonymous user in text mode, use the user name ftp, password is ftp, to log in; if it is a tool to anonymous FTP login, the user name and password are: anonymous. By default, anonymous users can access and download, but can not upload, delete, create directory, execute files and other operations

Local users can log in and leave the home directory to another directory have access to, and upload and download in the case of rights allowed to write local user file /etc/vsftpd.ftpusers the prohibition login.

2. To allow anonymous users to upload files

/Etc/vsftpd/vsftpd.conf need to modify the file, the following two before the # removed.

anon_upload_enable = YES

anon_mkdir_write_enable = YES

Restart vsftpd service.

3. Only allow anonymous users to access

Refers to a local account access, modify the /etc/vsftpd/vsftpd.conf file, remove the following two #. Local_enable = YES

Write_enable = YES

Restart the VSFTPD service.

4. Set the welcome information

Modify /etc/vsftpd/vsftpd.conf file


***** is the welcome information for settings.

Restart the VSFTPD service.

5. Set the maximum transmission rate

Modify /etc/vsftpd/vsftpd.conf file

Setting the maximum transfer rate of anonymous users is 20kbps, and should add the following statement:

Anon_max_rate = 20000

Setting the maximum transfer rate of the local account to 1Mbps, add the following statement:

LOCAL_MAX_RATE = 1000000

6. Set the maximum number of servers and maximum number of users

Modify /etc/vsftpd/vsftpd.conf file

Setting up the server to 99, you should add the following statement:


Set the maximum number of connections in the same period of the user, you should add the following statement:


7. Host anonymous access servers for some IP segments

Modify the vsftpd.conf file, confirm that there is a statement:


Modify the /etc/hosts.allow file, add 1 line command:

vsftpd: deny

Indicates that the host access to the IP is to access the FTP server.

Restart the VSFTPD service.

8. Transfer data with ASCII method

Modify the /etc/vsftpd/vsftpd.conf file,



Restart the VSFTPD service.

9. Set the data transfer interrupt interval

Modify the /etc/vsftpd/vsftpd.conf file,


Indicates that the idle session time is 600 seconds.

Data_connection_timeout = 120

Indicates that the data connection timeout is 120 seconds.

Restart the VSFTPD service.

(2) Local users access configuration

1. Use the user list to access control

Modify the /etc/vsftpd/vsftpd.conf file, set the following statement:

UserList_enable = NO

The user in the vsftpd.ftpuser file will be disabled from accessing the FTP server.

UserList_enable = YES

UserList_Deny = NO

Indicates that only users in the vsftpd.user_list file are allowed to access the FTP server.

UserList_enable = YES

UserList_deny = YES

It indicates that users in vsftpd.ftpuser and vsftpd.user_list files cannot access the FTP server.

2. Restrict access to user directory

Modify /etc/vsftpd/vsftpd.conf file

chroot_local_user = yes

Indicates that other directories or files other than your own directory cannot be accessed after logging in.

3. Modify the default port

The default port of the FTP server is 21, if you need to modify the port, modify the /etc/vsftpdpd/vsftpd.conf file, the following statement:

Listen_Port = 4444

Indicates that the port number of the FTP server is 4444 and should be as larger than 4000.

VSFTPD Log in to 530 login incorrect error with root users

There is a directory in the etc / pam.d / vsftpd pointing to ETC / VSFTPD / FPTUSERS

You can delete root inside.

The ROOT user has upload the authority, but also off the system’s firewall, but the FTP connection still appears “500 OOPS: Cannot Change Directory: / root” error, how to solve it?


1. View SELinux status:

Sestatus -b | grep ftp exactly, just viewed the status of FTP.

2, can be seen in the results of the appearance



such as. We can now set it to ON now.

3, setsebool -p ftpd_disable_trans on or setsebool -p ftp_home_dir on4, restart vsftpd: service vsftpd restart

5, slowly enjoy the fun of FTP.

VSFTPD login error problem: 500 OOps: Cannot Change Directory: / root

You can use a FTP client to try to log in on Windows. This time I usually report a mistake.

Invalid user rights error

Delete root and user_list in FTPUSER

It is best to turn off Linux’s firewall: ChkConfig iptables OFF

Then log in again

500 OOOPS: Cannot Change Directory: / root


1. View SELinux status:

Sestatus -b | GREP FTP

2, can be seen in the results of the appearance



such as. We can now set it to ON now.

3, setsebool -p ftpd_disable_trans on or setsebool -p ftp_home_dir on

4, restart vsftpd: service vsftpd restart

Boot default VSFTP service starts automatically:

Turn off the firewall permanently or turn off

ChkConfig iptables on

ChkConfig iptables OFF

Method 1: (Common, convenient)

[root @ localhost etc] # chkconfig –list | grep vsftpd (view situation)

VSFTPD 0: OFF 1: Off 2: Off 3: Off 4: Off 5: Off 6: OFF

[root @ localhost etc] # chkconfig vsftpd on (execution ON setting)

Or: Method 2:

Modify file /etc/rc.local, put row / usr / local / sbin / vsftpd & insert files to implement boot automatically.

530 permission denied.

Today, Linux is also installed under the virtual machine. Now I want to launch the FTP server that comes with Linux: #service vsftpd start. If you want Linux boot is automatically started with FTP Server: #CHKCONFIG VSFTPD ON

Running PUTTY, entering the root, an error 530 permission Denied, feeling strange, because the ordinary user can enter.

The reason is that we /etc/vsftpd.ftpusers and /etc/vsftpd.user_list banned the root user. At this time we need to modify these two files.

(1) /etc/vsftpd.user_list’s default file (that is, means specific users)

# vsftpd UserList

# Ixlylist_deny = no, only allow users in this file

# IF UserList_Deny = YES (Default), Never Allow Users in this file, and

# Do Not Even Prompt for a password.

# Note That the default vsftpd pam config also checks /etc/vsftpd.ftpusers

# for users what are dend.















At this time we have to add a #.

(2) /etc/vsftpd.ftpusers default file (all user properties that can log in to this FTP)
















At this time we have to add a #.

The following error occurred:

200 Port Command Successful. Consider Using PASV.

425 Failed to Establish Connection.

The error caused the error due to the reason for the Window’s firewall, and the firewall can be turned off.

Fourth, linux disresses and installs Mysql

1. Find no mysql before

Command: rpm -qa | grep -i mysql

You can see two packs of mysql:



2. Delete mysql

Delete command: rpm -e –NodePs package name

(rpm-Ev mysql-4.1.12-3.rhel4.1)

3, delete the old version mysql development header file and library

Command: RM-FR / USR / LIB / MySQL

RM-FR / USR / include / mysql

Note: The data and /etc/my.cnf in / var / lib / mysql are uninstalled, and if it is determined, it is hand-deleted.

Rm -f /etc/my.cnf


Install mysql

Prepare before installation: two rpm packages



1. Install the server:

Command: rpm -ivh mysql-server-5.1.20-0.glibc23.i386.rpm

2, install the client

Command: rpm -ivh mysql-client-5.1.20-0.glibc23.i386.rpm

3, login mysql

The command to log in to mySQL is mysql, MySQL’s use syntax is as follows:

MySQL [-U Username] [-H host] [-p [password]] [dbname]

UserName and Password are mysql username and password, MySQL’s initial management account is root, no password, note: This root user is not Linux system user. MySQL default user is root, because there is no password in the initial, just type mysql for the first time.

[root @ localhost ~] # mysql

1, command

USR / bin / mysqladmin -u root password ” new-password ”

Format: mysqladmin -u username -P old password Password new password

2, example

Example 1: Add a password to the root 123456.

Type the following command:

[root @ Test1 local] # / usr / bin / mysqladmin -u root password 123456

Note: Because the root does not have a password at the beginning, the -p old password can be omitted.

“MySQL>” prompt appears, congratulations, the installation is successful!

Added the login format after the password is as follows:

Mysql -u root -p

ENTER Password: (Enter the password)

Size: 39.9 KB View Image Accessories

Related Posts