How to setup a FTP Server on Linux

Step 1. Install vsftpd

 

You can quickly install vsftpd on Linux server in the command line:dom

 

  1. sudo yum install vsftpd  ide

 

Step 2. Configure vsftpd

 

Once VSFTP is installed, you can adjust the configuration.ui

Open up the configuration file:this

 

  1. sudo vi /etc/vsftpd/vsftpd.conf  spa

 

One primary change you need to make is to change the Anonymous_enable to No:rest

 

  1. anonymous_enable=NO  orm

 

Prior to this change, vsftpd allowed anonymous, unidentified users to access the VPS's files. This is useful if you are seeking to distribute information widely, but may be considered a serious security issue in most other cases. After that, uncomment the local_enable option, changing it to yes.server

 

  1. local_enable=YES  ci

 

Finish up by uncommenting command to chroot_local_user. When this line is set to Yes, all the local users will be jailed within their chroot and will be denied access to any other part of the server.it

 

  1. chroot_local_user=YES  

 

Finish up by restarting vsftpd:

 

  1. sudo service vsftpd restart  

 

In order to ensure that vsftpd runs at boot, run chkconfig:

 

  1. chkconfig vsftpd on  

  2. service vsftpd restart  

 

Step 3. Set the home directory of the user with the following command

 

  1. usermod -d /var/www/my.domain.example/ exampleuser  

 

you can use following command to create a Linux user:

  1. useradd <-username>  

  2. passwrd <-username>  

  3. chown –R <-username> /var/www/mydomain.com 

相關文章
相關標籤/搜索