[Practice has proved that finishing line] vsFTPd installation and configuration

2011-09-21  来源:本站原创  分类:OS  人气:331 

Reference

1. VsFTPd configuration:

http://www.centos.bz/2011/03/centos-install-vsftpd-ftp-server/

2. Centos user & group permissions to add and delete users & Detailed questions:

http://zh888.blog.51cto.com/1684752/385605

3. Setsebool command:

http://hi.baidu.com/ma95221/blog/item/c779741137cc121bb8127b4f.html

4 restricted user access the directory:

http://www.cntxk.com/CataNews/42/info4735.html

5 shows the configuration file and restrict access to Chinese users:

http://litvip.com/2011/03/01/187

Sequence beginning

Network resources, but I do not know why, when I follow the online step by step technical articles after the result is always failure, the problem re out.

And the world is a big copy the article, through the search results got mostly the same.

Decided to record their own step by step clear of the operation, summarized the article, to facilitate his own future reference, may also be helpful to others.

Purpose

In the CentOS install and configure vsFTPd services, and can be accessed by other machines.

Here is what CentOS and vsFTPd not boil technique.

Step

This is the version of CentOS 6's operation.

Note: The following commands are executed in the root user.

(1) to install the vsftpd

Nothing to say a command to get.

#yum install vsftpd

the middle will be prompted to confirm, type "y" Enter

Start the vsftpd service

#service vsftpd start

Management vsftpd related commands:
Stop vsftpd:

#service vsftpd stop

restart vsftpd:

#service vsftpd restart

(2) add the ftp user to add ftpuser <br /> Here is the user, set the root directory is / home / ftpuser, forbids the user from SSH login permissions, and restrict their access to other directories.

Increase user ftpuser, pointing to the directory / home / ftpuser, prohibit login SSH access.

#useradd -d /home/ftpuser -g ftp -s /sbin/nologin ftpuser

Set user password

#passwd ftpuser

(3) Configure the firewall <br /> open / etc / sysconfig / iptables file

#vi /etc/sysconfig/iptables

before the REJECT line to add the following code

-A INPUT-m state - state NEW-m tcp-p tcp - dport 21-j ACCEPT

Save and close the file, restart the Firewall

#service iptables start

(4) Restart vsftpd
After each configuration, do not forget to restart vsftpd, so that the settings take effect

#service vsftpd restart

(5) Modify SELinux Settings

But even opening the firewall, then through the FTP client still can not access, it will report an error:
500 OOPS: cannot change directory: / home / ftpuser
500 OOPS: priv_sock_get_cmd

There is also need to modify the SELinux settings.

View the settings through the command getsebool

#getsebool -a|grep ftp

set

#setsebool ftp_home_dir 1

command setsebool
Vsftpd restart
service vsftpd restart

Now you can use an FTP client to access the

(6) limit user access to directory

Generally set the FTP service like specified user's access path, the server does not allow users to wander.

Need to configure the vsftpd.conf file.

Modify the configuration file vsftpd.conf

#vi /etc/vsftpd/vsftpd.conf

Open vsftpd.conf file, modify or add the following.

anonymous_enable=NO       #  Prohibit anonymous anonymous user login
local_enable=YES                #  Allows local users to log in
write_enable=YES                #  Allow the user has write access login  (  Upload, delete  )

#  The next three configurations is very important
#chroot_local_user  Set to YES, then all users by default will be  chroot,
#  User directory will be limited to his own home under  ,  Can not change directory up  .
#chroot_list_enable  Set YES, that is so  chroot  List of valid users  .
#  ★ super important  :  If chroot_local_user set  YES,  Then chroot_list_file
#  Set the file is not being  chroot  Users  (  You can change the directory up  )
#  ★ super important  :  If chroot_local_user set  NO,  Then chroot_list_file
#  Set the file, is  chroot  Users  (  Can not change directory up  )
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list        #  Control the root user list file
user_config_dir=/etc/vsftpd/user_conf   #  Each user's configuration files directory

Modify chroot_list file, add the root user ftpuser control

#vi /etc/vsftpd/chroot_list

Create a user profile

#mkdir /etc/vsftpd/user_conf
#vi /etc/vsftpd/user_conf/ftpuser

Set in the file path to the user's access ftpuser, as follows:

local_root = / data / www

(7) re-modifies the SELinux settings

After the above steps to set the specified ftp user to be connected to the service point to the root directory on / data / www down.
But try to upload the file does not work, there is also a need to modify the SELinux settings.

#setsebool allow_ftpd_full_access 1

Restart vsftpd

service vsftpd restart

(8) restrict access to users

This FTP service can be used normally, but in addition to root and other system users, other users can connect to the server via FTP service on;
But we just want to open ftpuser user, other users are not allowed to access the FTP service.

#vi /etc/vsftpd/vsftpd.conf

Open vsftpd.conf file, modify or add the following.

#userlist_enable=YES,  Effective user access control lists, file is  /etc/vsftpd/user_list
#userlist_deny=YES,/etc/vsftpd/user_list  Users can not log in
#userlist_deny=NO,  Only the / etc / vsftpd / user_list users can log
#  ★ important  : No matter how the settings here, only further restrict users  ,  Just above  /etc/vsftpd/ftpusers
#  Superimposed on the effects, such as  /etc/vsftpd/ftpusers  There are the root user  ,  Even if you set
#userlist_deny=NO  And / etc / vsftpd / user_list have  root,  That root is not logged in  !
userlist_enable=YES
userlist_deny=NO

Set user_list file

#vi /etc/vsftpd/user_list

Clear user_list contents of the file, only write access to FTP services allow the user name

Restart vsftpd

#service vsftpd restart
相关文章
  • [Practice has proved that finishing line] vsFTPd installation and configuration 2011-09-21

    Reference 1. VsFTPd configuration: http://www.centos.bz/2011/03/centos-install-vsftpd-ftp-server/ 2. Centos user & group permissions to add and delete users & Detailed questions: http://zh888.blog.51cto.com/1684752/385605 3. Setsebool command: htt

  • [Practice has proved that finishing line] CentOS 6 in the easy set up Apache James mail server 2011-09-23

    Reference 1 set up with Apache James mail server to send and receive e-mail practices (a) http://zhaipuhong.iteye.com/blog/213246 2. James + mysql http://godchenmeng.iteye.com/blog/516680 3. Apache James user information database to store and passwor

  • [Practice has proved that finishing line] TP-LINK TL-PA201 Power Line Adapter Utility 2011-10-08

    Reference Some use refer to the original article Jingdong Products http://www.360buy.com/product/277420.html Order Network resources, but I do not know why, when I follow the online step by step technical articles after the result is always failure,

  • [Practice has proved that finishing line] CentOS 6 in the easy set up Apache James mail server (continued 1) - into the database of users and e-mail 2011-09-28

    Reference 1. James + mysql http://godchenmeng.iteye.com/blog/516680 2. MYSQL user rights management (Grant, Revoke) http://read.newbooks.com.cn/info/197474.html Order Network resources, but I do not know why, when I follow the online step by step tec

  • vsFTPd Installation and Configuration 2010-10-14

    vsFTPd Installation and Configuration vsFTPD is a small, easy to use FTP server program, is a Linux distribution in the most respected in the FTP server program, is characterized by small, light, safe to use. vsFTPd installation In the latest major r

  • Linux vsftpd installation and configuration 2010-07-29

    Ftp server vsftpd is the safest. But the configuration a little trouble for that. It is configured, can be used, but not ideal. Experienced comrades can explore. # # Installed vsftpd # Apt-get install vsftpd # # Repair a configuration file # Gedit /

  • vsftpd installation and configuration instructions 2010-10-12

    1. Wget ftp://vsftpd.beasts.org/users/cevans/vsftpd-2.2.2.tar.gz 2. Tar-xvzf vsftpd-2.2.2.tar.gz 3. Cd vsftpd-2.2.2 4. Make 5. Make install 6. According to the situation the following modifications, save it as / etc / vsftpd.conf Quote # Disables ano

  • Linux vsftpd installation configuration to use (more) 2010-02-26

    Linux vsftpd installation configuration to use (more) In this paper, a number of previous articles written on many occasions with their own installation and configuration experience, written in more detail, the article finally ftp command set with al

  • vsftpd Installation Tutorial 2010-12-19

    vsftpd Installation Tutorial 2009-02-01 05:13 Installation is very simple, according to the general situation can be installed inside the install to succeed (my CENTOS 4.4) Now I write the installation process to share: 1. Extract and compile the sof

  • Vsftpd server installation and configuration of the ftp address to the local method of mapping mount 2010-12-21

    Vsftpd server installation and configuration of the ftp address to the local method of mapping mount 1. Installing ftp server daemon program luther @ gliethttp: ~ $ sudo apt-get install vsftpd luther @ gliethttp: ~ $ sudo mkdir-p / home / ftp_dir / u

  • Ftp under Ubuntu installation and configuration (vsftpd) 2011-07-27

    Ftp under Ubuntu software has a good variety: google this: Some of the general characteristics: wu-Ftp: relatively old, but more for its attacks, set much trouble, but more powerful. proFtpd: wu-Ftp can be achieved, and all the features of server-U.

  • centos 5 yum vsFTPd FTP server installation and configuration 2011-08-29

    vsftpd as FTP server, the Linux system is very common. Here we describe how to install centos system vsftp. What is vsftpdvsftpd is a Linux distribution in the most respected in the FTP server program. Characterized by small, light, safe to use. vsft

  • mantis installation and configuration - more success Edition 2010-06-07

    Try to research the next mantis. Find installation and configuration is more responsible, a lot of trouble during the encounter configuration problems, Such as mail, garbled, icon support, project path access, etc., order online no detailed informati

  • Detailed installation and configuration under linux vsftp 2010-10-14

    Detailed installation and configuration under linux vsftp 1, run the command yum install vsftpd Specific details are as follows: (If you can not update, you first configure access to the Internet, I have a document called CentOS in VMware, how to net

  • CentOS-FTP Installation and Configuration 2010-12-23

    Transfer: http://blog.techippo.org/archives/348 1. Install vsftpd yum install vsftpd 2. Start / restart / shut down vsftpd server [Root @ localhost ftp] # / sbin / service vsftpd restart Shutting down vsftpd: [OK] Starting vsftpd for vsftpd: [OK] OK

  • Centos installation and configuration under the vsftp (rpm) 2011-09-15

    yum install vsftpd 2 start / restart / shut down vsftpd server [Root @ localhost ftp] # / sbin / service vsftpd restart Shutting down vsftpd: [OK] Starting vsftpd for vsftpd: [OK] OK indicates that the restart was successful. Startup and shutdown wer

  • ubuntu - Java Installation and Configuration 2010-03-28

    Java installation and configuration from Ubuntu English - http: / / wiki.ubuntu.org.cn / Java% E5% AE% 89% E8% A3% 85% E9% 85% 8D% E7% BD% AE * Install java: Open a terminal, execute the following command, or use Adept / Synaptic Software Manager, in

  • Apache2 + php5 + mysql under the windows installation and configuration diagrams 2010-02-16

    First ready software: Download the official Apache: apache_2.0.55-Win32-x86-no_ssl.msi , more versions here ; Download the official php: PHP-5.0.5-win32.zip , more mirror download address , more version of the download ; Download the official mysql:

  • JBoss 5.0 installation and configuration Xiangjie 2010-03-26

    JBoss 5.0 installation and configuration Xiangjie 1. Download and install JBoss In this article, I downloaded the JBoss version: JBOSS5.0 Beta4. Download: http://www.jboss.org/jbossas/downloads/ In the above download page to download JBOSS5.0 Beta4.z

  • haproxy_keepalived Installation and Configuration 2010-03-30

    haproxy_keepalived Installation and Configuration Reference to "ubuntu server best" learning how to configure the haproxy load balancing. Leave a simple installation and configuration records, and then further study. Installation Environment: ub